{"id":173558,"date":"2024-01-15T11:56:28","date_gmt":"2024-01-15T10:56:28","guid":{"rendered":"https:\/\/liora.io\/en\/?p=173558"},"modified":"2026-02-12T11:56:22","modified_gmt":"2026-02-12T10:56:22","slug":"chatgpt-how-does-this-nlp-algorithm-work","status":"publish","type":"post","link":"https:\/\/liora.io\/en\/chatgpt-how-does-this-nlp-algorithm-work","title":{"rendered":"ChatGPT: How does this NLP algorithm work?"},"content":{"rendered":"\n<p><strong>You&#8217;ve probably heard of ChatGPT, the tool that can answer all your questions in real time? Launched at the end of 2022, it looks set to revolutionise the field of artificial intelligence. We tell you all about it!<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/liora.io\/en\/autogpt-discover-the-new-tool-that-makes-chatgpt-autonomous\">ChatGPT (Chat Generative Pretrained Transformer) was developed in November 2022<\/a> by the US company OpenAI. It is a language model that enables users to communicate in real time with a bot in online chat. The bot is thus capable of holding a conversation in several languages, answering questions, transmitting information on a wide range of subjects and sharing ideas.<\/p>\n\n\n\n<p>In addition to these varied capabilities, <a href=\"https:\/\/liora.io\/en\/elon-musk-develops-his-own-ai-truthgpt-in-search-of-the-universal-truth\">ChatGPT has the ability to memorise conversations,<\/a> enabling it to take previous responses into account and let the user make corrections. It&#8217;s an intelligent, innovative tool that facilitates communication and access to knowledge!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-but-how-does-chatgpt-work\">But how does ChatGPT work?<\/h2>\n\n\n\n<p><a href=\"https:\/\/liora.io\/en\/nlp-training-become-an-nlp-pro-and-master-the-art-of-natural-language-processing\">ChatGPT is an NLP (Natural Language Processing) algorithm<\/a> that understands and generates natural language autonomously. To be more precise, it is a consumer version of GPT3, a text generation algorithm specialising in article writing and sentiment analysis. <strong>ChatGPT works like GPT3,<\/strong> using a model pre-trained on a huge corpus of 500 billion textual data. It uses two different types of learning: supervised learning and reinforcement learning.<\/p>\n\n\n\n<p>During the supervised learning phase, it receives conversations in which both roles (bot and user) are played so that the data is labelled (questions and associated expected answers). During the<strong> reinforcement learning phase,<\/strong> the previous interactions are used to rank the answers. This ranking is carried out by human trainers (Reinforcement Learning from Human Feedback) and enables a reward model to be created based on this ranking. In addition to pre-training, the algorithm continues to train itself during its interactions with users. This is what enables it to memorise the context and remember the messages in a conversation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-reinforcement-learning-from-human-feedback-in-detail\">Reinforcement Learning from Human Feedback in detail<\/h2>\n\n\n\n<p>As mentioned above, the reinforcement learning phase is more precisely Reinforcement Learning from Human Feedback (RLHF), which works with real human trainers. This phase is divided into two stages:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>After performing the supervised learning phase on labelled data and learning a supervised font, a Supervised Fine Tuning (SFT) model is generated.<\/li>\n\n\n\n<li>Human trainers then vote on the relevance of the model outputs, creating a comparison dataset on which an RM (Reward Model) is trained.<\/li>\n<\/ol>\n\n\n\n<p>The RM reward model is optimised<strong> using the PPO reinforcement learning algorithm<\/strong>. The PPO algorithm is an on-policy algorithm that learns and updates a current policy based directly on the actions and rewards obtained. This generates a new model, called the &#8220;Policy Model&#8221;. This policy model can be used to improve the initial SFT model and obtain a new comparison dataset. The two steps can then be repeated in a loop.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-and-what-about-developers\">And what about developers?<\/h2>\n\n\n\n<p>ChatGPT also has capabilities normally only available to computer developers. It can generate code in several programming languages (<a href=\"https:\/\/liora.io\/en\/mastering-nltk-your-ultimate-guide-to-pythons-nlp-toolkit\">Python<\/a>, Java, C++, etc.) and develop an algorithm to solve a problem. To obtain such a result, all you have to do is clearly state what the code to be generated should return. It is also an established debugging tool, capable of identifying the source of a computer bug and correcting it, just like any other debugging software. For Data Engineers, ChatGPT is also very useful as it can simulate a Virtual Machine (VM) with a Linux terminal.<\/p>\n\n\n\n<p>Finally, ChatGPT can also detect vulnerabilities in a program. ChatGPT therefore seems to be a functional NLP model from an editorial point of view or from an IT point of view, and in many fields!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-so-what-are-the-limitations-of-this-tool\">So what are the limitations of this tool?<\/h2>\n\n\n\n<p>When we asked, <strong>ChatGPT<\/strong> replied: &#8220;I am a language processing model trained by <strong>OpenAI.<\/strong> My knowledge is limited to the cut-off date of my training data, which is 2021. I cannot surf the Internet to check information or access data that is not part of my memory. I do my best to answer questions accurately and completely, but my answers may not always be correct or up to date&#8221;.<\/p>\n\n\n\n<p>Indeed, since its launch, the main criticisms levelled at <strong>ChatGPT<\/strong> relate to its temporal limit, since its knowledge stops at events prior to the year 2021, and erroneous answers that can cause false information to be shared, even if the error rate remains minimal. On the subject of code, <strong>ChatGPT<\/strong> also has its limitations, since the code generated can contain a lot of errors beyond a certain level of difficulty.<\/p>\n\n\n\n<p>The tool is restricted to classic, repetitive programmes, but is not capable of performing computer analysis tasks, for example. Finally, its cybersecurity skills are too easily accessible, and many fear that they could be misused by hackers for malicious purposes. From an ethical point of view, the tool faces other problems. Its use has been banned and access to it has been banned from the computers of certain American schools in the face of numerous cases of plagiarism.<\/p>\n\n\n\n<p>Finally, like any statistical model, <strong>ChatGPT<\/strong> has emotional limits. Unlike human intelligence, it has no thoughts, intuition, morals or emotions, which can be a certain danger. So, like any innovation, ChatGPT has its limits. Nevertheless, it remains a <a href=\"https:\/\/liora.io\/en\/exploring-the-boundaries-of-artificial-intelligence\">high-potential artificial intelligence<\/a> tool whose performance continues to improve over time!<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex is-content-justification-center wp-container-core-buttons-is-layout-675d14d2\" style=\"margin-top:var(--wp--preset--spacing--columns);margin-bottom:var(--wp--preset--spacing--columns)\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/liora.io\/en\/courses\/\">Discover our Liora Training courses<\/a><\/div>\n<\/div>\n\n\n\n<p>If you&#8217;d like to find out more about other NLP algorithms and other key areas <a href=\"https:\/\/liora.io\/en\/google-creates-the-first-regulation-for-artificial-intelligence\">where AI is coming increasingly to the fore,<\/a> take a look at <a href=\"https:\/\/liora.io\/en\/blog\">our blog.<\/a><\/p>\n\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What is ChatGPT and how does it work?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"ChatGPT is an AI chatbot powered by a large language model called a generative pre\u2011trained transformer (GPT), which has been trained on huge amounts of text data and uses that training to generate human\u2011like responses based on patterns in language.\u00a0([turn0search7][turn0search25])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What kind of model underlies ChatGPT?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"ChatGPT is based on a transformer architecture \u2014 a deep learning design that uses self\u2011attention mechanisms to process sequences of words in parallel, allowing it to understand context and relationships across input text before generating responses.\u00a0([turn0search23][turn0search25])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How does ChatGPT generate text?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Once trained, ChatGPT takes user input, converts it into tokens (numerical representations), and predicts the next word or sequence of words one at a time based on learned patterns, producing coherent and contextually relevant text.\u00a0([turn0search7][turn0search26])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"How is ChatGPT trained?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"ChatGPT is first pre\u2011trained on massive volumes of text data in a self\u2011supervised way to learn language structure, and then fine\u2011tuned \u2014 often using techniques like reinforcement learning from human feedback (RLHF) \u2014 to align responses better with human preferences.\u00a0([turn0search24][turn0search7])\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"What role does human feedback play in ChatGPT\u2019s training?\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Human evaluators rank model outputs to build a reward model that guides fine\u2011tuning via reinforcement learning, helping the system generate more useful, safe, and relevant responses that align with user expectations.\u00a0([turn0search24][turn0search5])\"\n      }\n    }\n  ]\n}\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>You\u2019ve probably heard of ChatGPT, the tool that can answer all your questions in real time? Launched at the end of 2022, it looks set to revolutionise the field of artificial intelligence. We tell you all about it!<\/p>\n","protected":false},"author":82,"featured_media":173559,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"editor_notices":[],"footnotes":""},"categories":[2433],"class_list":["post-173558","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai"],"acf":[],"_links":{"self":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/173558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/users\/82"}],"replies":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/comments?post=173558"}],"version-history":[{"count":5,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/173558\/revisions"}],"predecessor-version":[{"id":206600,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/posts\/173558\/revisions\/206600"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media\/173559"}],"wp:attachment":[{"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/media?parent=173558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liora.io\/en\/wp-json\/wp\/v2\/categories?post=173558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}