Try our custom LLM Masker
Featured Image

24 min read

07/11/2023

What is an LLM (Large Language Model)?

LLMs or Large Language Models (LLM) are advanced deep learning algorithms capable of performing a wide range of tasks related to natural language processing (NLP). At Pangeanic we know something about it because we have been building (more modest) language models for machine translation, anonymization or data classification since 2010. The difference we have all noticed since late 2022 or early 2023 is in the size and amount of training data. The new models, based on the Transformers architecture - currently the most popular - are trained on vast data sets, giving them an impressive ability to recognize, summarize, translate, predict and generate text. If we also add a chatbot functionality to interact, as OpenAI did with ChatGPT, Meta with LlaMa2 or Google with Bart, then we have a new experience, a cognitive experience that humans have not had with any machine. That's why we have so much fun and get so "hooked" on models like ChatGPT: to our brains, we are having a cognitive experience, a conversation, just as we might have with a highly knowledgeable librarian or anyone else.

This has led to a viral explosion in interest in large language models, and some non-experts have exclaimed that they contain reasoning capabilities, confusing the language generation capability and technology of a Chatbot with actual intelligence. A great language model does not reason, it does not think. However, it can extract information admirably because it has been trained with the equivalent of 20,000 years of reading.

For a deeper dive into the technology and advancements behind large language models, exploring comprehensive resources can provide valuable insights. Large language models are reshaping how we interact with digital information, offering new possibilities for understanding and generating human language.

 

Are LLMs safe and what are guardrails?

Guardrails in LLMs are a set of controls and safety barriers that monitor a user's interaction with a large language model (LLM) with a view to dictate that it does not deviate and thus ensure its quality and consistency.

In essence, the guardrails in LLMs establish a set of programmable rule-based systems that sit between the users and the foundational models. These systems act as rules that ensure that the AI model operates according to the principles defined by the organization, setting clear and defined boundaries for its behavior, and preventing the generation of inappropriate or harmful responses that might come from the training data. For example, early GPT models were criticized for the amount of toxic content they could produce.

Guardrails can be seen as a way of "correcting" the model when it generates content that deviates too far from the norms. The rules and restrictions that the model must comply with are established in advance, such as avoiding profanity, sexist or discriminatory words, or ensuring that the model's responses are written in an appropriate and respectful tone.

Imagen 1, cortesía de Bing Image Creator

Image 1, courtesy of Bing Image Creator 

When the model generates a response, it is evaluated against the established guardrails, and if it does not comply with them, the LLM is asked to generate a new response that does comply with the established requirements.

The importance of guardrails in LLMs lies in the fact that they allow the developers and users of these models to control and direct their behavior, ensuring that the models are used in a responsible and ethical manner. In addition, guardrails also help prevent errors and potential problems that could arise from a lack of control over the model, such as the generation of inappropriate or harmful content.

The guardrails can be used to:

  • Prevent LLMs from generating harmful or offensive content;

  • Ensure that LLMs are used in a manner aligned with the organization's values and mission;

  • Protect the privacy and security of user data;

  • Improve the reliability and accuracy of LLMs.

Some examples of safety barriers in LLMs are:

  • Blacklists and whitelists: Guardrails can be used to create blacklists of words and phrases that LLMs cannot generate, and whitelists of words and phrases that they can generate;

  • Content filters: Guardrails can be used to filter LLM-generated content for harmful or offensive content;

  • Bias detection: Guardrails can be used to detect bias in LLM results and filter or flag them for human review;

  • Fact-checking: Guardrails can be used to check LLM results and ensure their accuracy.

Guardrails are an important part of responsible LLM development and deployment. By implementing these controls, organizations can help ensure that LLMs are used securely and ethically.

Pangeanic has collaborated with the Barcelona SuperComputing Center in the creation of guardrails for LLMs. See the LLMs case study.

 

Green lists, red lists

In the context of large linguistic models (LLMs), "green lists" are related to a method used to embed watermarks in the text generated by these models. The idea behind this method is to mitigate potential damage that could result from the text generated by LLMs. In the context of large linguistic models (LLMs), green lists refer to a set of words, phrases or sentences that are considered acceptable or desirable to be generated by the model. These lists are usually created by humans and serve to guide the model output into a coherent and meaningful text.

Green lists can be used in a variety of ways during the LLM training process. Here are some examples:

  1. Seeding: At the beginning of training, the model can be initialized with a small set of predefined words or phrases from the green list. This helps the model to start generating consistent text and reduces the risk of producing random or meaningless results.

  2. Instructional engineering: Researchers often carefully design questions to elicit specific answers from the model. Green lists can be used to ensure that the instructions contain the appropriate language and concepts, making it easier for the model to generate relevant and consistent answers.

  3. Evaluation metrics: Green lists can be used as part of evaluation metrics to assess the quality and relevance of the model outputs. For example, researchers can compare the text generated by the model against a green list of relevant keywords or phrases to determine the extent to which the model understands the topic in question.

  4. Directing the model:Green lists can be actively used during inference (generation) to direct the model towards desired topics, styles or formats. This can be done by conditioning the model input or by providing additional cues that encourage the model to focus on specific aspects of the task.

  5. Safety and ethics: Green lists can help mitigate potential risks associated with LLMs, such as biased or prejudicial results. By defining a set of approved words, phrases or concepts, the model is less likely to generate content that could be considered inappropriate or offensive.

It is important to note that while green lists can be useful in guiding LLM behavior, they are not always effective in avoiding undesirable outcomes. Models may produce unexpected or undesired responses, especially if exposed to conflicting or ambiguous inputs. Therefore, it is essential to continue to monitor and evaluate the performance of LLMs even when using green lists.

  1. The concept is to create a probability distribution for the next word to be generated and adjust this process to embed a watermark. A hash code generated from a previous token classifies the vocabulary into "green list" and "red list" words.

  2. A method proposed by Kirchenbauer et al. (2023) divided the vocabulary into red and green lists and the system learned to prefer to generate tokens from the green list. This division improves the robustness of algorithms that provide a watermark for LLMs.

  3. A specific random number (seed in the AI field) can randomly divide the entire vocabulary into two lists of equal size, a "green list" and a "red list". The next token is subsequently generated from the green list, as part of a method for detecting text generated by large language models (LLM).

  4. In another method, the division into "green list" and "red list" is based on the prefix token, which subtly increases the probability of choosing from the green list. If in a watermarked sentence every second token is edited by changing it to its synonym, it becomes difficult to determine the green/red lists for each token. This method for detecting text generated by LLMs is based on exploiting the fact that LLMs have a higher probability of generating tokens similar to those they have already generated. This is because LLMs are trained on large textual datasets and learn to predict the next token in a sequence based on previously generated tokens.

In this method, a watermark is created by randomly dividing the vocabulary into a "green list" and a "red list". The green list contains the tokens most likely to be generated by LLMs, and the red list the tokens with the least, so that when the LLM generates a text, it is forced to choose tokens from the green list. This creates a subtle watermark in the text, which some frequent users of LLMs detect by the "neutral, polite style" characterized by shallow, non-confrontational responses that do not take sides and the use of certain expressions and conjunctions. Within the system, it can be detected by checking the proportion of tokens that are on the green list.

If the text is edited by changing every second token by its synonym, it becomes more difficult to detect the watermark. This is because the synonyms are likely to be in the green list as well.

Some current studies focus on the use of sophisticated methods, such as statistical analysis, to detect AI-generated text.

Transformers architecture and its meaning

An LLM is a large linguistic model. It is a type of machine learning model that can perform a variety of natural language processing (NLP) tasks, such as generating and classifying text, answering conversational questions, and translating text from one language to another.

Imagen 2, Los Transformers cambiaron la forma de procesar el lenguaje. Cortesía de Bing Image Creator

Image 2, The Transformers changed the way we process language. Courtesy of Bing Image Creator 

The term "large" refers to the number of values (parameters) that the model can change on its own during the learning process. Some of the most successful LLMs have hundreds of billions of parameters.

The heart of an LLM is usually a Transformers model. These are composed of an encoder and a decoder and are known for their ability to handle long-distance dependencies through what are known as self-attention mechanisms. As the name implies, self-attention, in particular multi-headed attention, allows the model to consider multiple parts of the text simultaneously, offering a more holistic and richer understanding of the content.

Key components of LLMs

Within these models, we find several layers of neural networks working together:

Embedding Layer: Transforms the input text into vectors, capturing its semantic and syntactic meaning.

Feedforward layer: It consists of fully connected networks that process the embeddings and help to understand the intent behind an input.

Recurrent Layer: Traditionally, they interpret words in sequence, establishing relationships between them.

Attention Mechanism: Focuses on specific parts of the text relevant to the task at hand, improving the accuracy of predictions.

Types of LLMs

There are several types of LLMs, among which the following stand out:

Generic language models:They focus on predicting the next word based on the training context.

Models trained by instructions: They are trained specifically for tasks such as sentiment analysis or code generation.

Dialog models: Currently the most popular, the ones that everyone uses. They are designed to simulate conversations, such as chatbots or AI-based assistants.

Given the naturalness of their expression, LLM-based solutions have received a lot of funding and many companies of all sizes are investing in customizing LLMs, with promises of large-scale problem solving across multiple industries, from healthcare - where they can help in diagnostics - to marketing, where sentiment analysis can be crucial.

How an LLM is trained

LLMs are trained with large amounts of data. The amount of data used to train GPT-1, GPT-2, GPT-3, GPT-3.5, GPT-3.5, GPT-4, LlaMa and LlaMa 2 has not stopped growing, nor has the need to acquire more clean, quality, original and reliable data. For example:

  • GPT-1 was trained with 40 GB of text data (600 billion words);

  • GPT-2 with 40 GB of text data;

  • GPT-3 increased the amount of text data by a factor of more than 16 [3][4] to reach 570 GB;

  • GPT-3.5: No specific information has been found on the amount of data used to train this model.

  • GPT-4: Trained with a larger amount of data than GPT-3, but no specific information on the amount of data used to train this model has been found.

  • LlaMa:No specific information was found on the amount of data used to train this model.

  • LlaMa 2: Trained with 40% more data than its predecessor LlaMa, allowing it to learn from a wider range of public sources. [1] [2].

Recall that the amount of data used to train a linguistic model is not the only factor that determines its performance, nor are billions of parameters. Other factors, such as the architecture of the model, the quality and cleanliness of the data and the training process, also play an important role.

Let's take as an example two of the world's best known LLMs: LlaMa2 (open source) and ChatGPT (closed source and commercial use).

LlaMa2

The goal was to build a single model that could perform well on multiple text-to-text tasks, such as text classification, sentiment analysis, named entity recognition, question answering, and, on a much smaller average, machine translation [5] [6]. The Meta team wanted to explore the scalability limits of transformer-based models and investigate the impact of size and complexity on performance. Their goal was to create a model that would serve as a solid foundation for future research on text-to-text transformation.

Imagen 3, META released Llama2 in summer 2023. Cortesía de Bing Image Creator

Imagen 3, META released LlaMa2 in summer 2023. Courtesy of Bing Image Creator

Architecture and components:

LlaMa2 uses a Transformers architecture with a novel combination of multiheaded self-attention networks and feedforward networks. It consists of several component models, each designed for a specific task: BERT for contextualized embeddings, RoBERTa for sentence-level semantic understanding, DistilBERT for question answering, and a custom-designed encoder-decoder module for sequence-to-sequence tasks. The model was trained by combining masked language modeling, next-sentence prediction, and task-specific targets.

Training process:

The authors used a distributed computational framework to train LlaMa2 with a dataset composed of text from a variety of sources, including books, articles and websites. 

Imagen 4, Datos utilizados para Llama2 . Cortesía de Bing Image Creator

Image 4, Data used for LlaMa2. 

A curricular learning strategy was employed, starting with a small subset of the data and gradually increasing the batch size and number of steps during training, using a mixture of 16-bit and 32-bit floating point numbers to store the model weights and performing gradient control to reduce memory usage.

Experimental results:

  • LlaMa2 performed best on several benchmark datasets, such as GLUE, SuperGLUE and WMT.

  • In the GLUE test, LlaMa2 outperformed the previous model, BERT, by an average of 4.8%.

  • In the SuperGLUE test, LlaMa2 improved BERT's performance by an average of 7.7%.

  • In the WMT translation task, LlaMa2 obtained competitive results compared to the most advanced models.

Essential Component: Human Feedback Reinforcement Learning

LlaMa2 was pre-trained using public data on the Internet (primarily CommonCrawl, and to a lesser extent from books and Wikipedia content but not from users of Meta systems). Next, an initial version of LlaMa-2-chat was created using supervised fine-tuning. Next, LlaMa-2-chat was iteratively refined using Human Feedback Reinforcement Learning (RLHF), which includes rejection sampling and Proximal Policy Optimization (PPO). The authors used a multi-objective optimization algorithm to search for optimal model parameters that balance competing objectives, such as perplexity, response quality, and safety. They incorporated RLHF to tune the model to align with human preferences and instruction following.

Imagen 5, Llama2 RLHF . Cortesía de Bing Image Creator

Image 5, LlaMa2 RLHF. From Meta’s Llama2 description article.

The RLHF process consisted of collecting human feedback in the form of ratings and comparisons between alternative responses generated by the model. The authors used this information to update model weights and improve model performance. They also added additional data to the training set, including Internet conversations and human-generated text, to increase the diversity of the training data.

One of the main challenges in training LlaMa2 was to solve the problem of exposure bias, whereby the model generates responses that are too similar to those observed during training. To solve this problem, the authors introduced a novel technique called Latent Adversarial Training (LAT), which adds noise to the input instructions to encourage the model to generate more diverse responses.

Another challenge was to ensure that the model was secure and respectful, and Meta's documentation addresses this issue in great depth. The authors developed a safety filter that rejected responses that were inappropriate or failed to meet certain criteria. They also incorporated a "buffering" mechanism that temporarily stopped training when unsafe responses were detected.

In terms of iterations, the authors performed multiple rounds of tuning and evaluation, gradually refining the model's parameters and improving its performance. They also experimented with different hyperparameters and techniques, such as adding additional layers or modifying the reward function, to optimize model performance.

Overall, the success of LlaMa2 relies on a combination of factors, such as the use of RLHF, large-scale iteration optimization, careful choice of hyperparameters, and innovative techniques to address specific challenges.

ChatGPT

ChatGPT is a service launched on November 30, 2022 by OpenAI and is currently offered as GPT-3.5 or GPT-4, members of OpenAI's proprietary generative pre-trained transformer (GPT) model series. ChatGPT is not a model trained from scratch, but is itself an enhanced version of GPT-3 with conversational (chatbot) capabilities and extensive memory for remembering conversations. The original GPT-3 model was trained on a huge Internet dataset (570 gigabytes of text and 175 billion parameters), including text extracted from Wikipedia, Twitter and Reddit.

Image 6, Amount of data used by OpenAI in ChatGPT training. Courtesy of Bing Image Creator

Image 6, Amount of data used by OpenAI in ChatGPT training.  

To refine ChatGPT, the team used a methodology similar to that used for InstructGPT. In terms of data, ChatGPT was developed using publicly available information on the Internet, information licensed from third parties, and information provided by users or human trainers. The process is described below.

The development and training process was a multifaceted process: supervised learning, generative reward and pre-training model, and reinforcement learning model with human feedback. As the Meta team would later do, OpenAI used reinforcement learning from human feedback to adjust ChatGPT to human preferences.

1. Generative pre-training

Initially, ChatGPT was pre-trained with a large corpus of text data, mostly from CommonCrawl and to a lesser extent, content from Wikipedia and books. The central idea was to learn a statistical language model that could generate grammatically correct and semantically meaningful text. Unsupervised learning was used as a technique, so that the model learned to predict the next word in a sentence by processing large amounts of text data. The Transformer architecture, especially known for its ability to handle sequences of data, plays a key role in this phase since it allows the model to understand the relationships between the different words in a sentence, thus learning the syntax and semantics of the language.

2. Supervised adjustment

After pre-training, the model underwent a supervised tuning phase in which it was trained with a dataset more specific to the task at hand, which in this case is to participate in a conversational dialogue. This dataset is typically generated with the help of human AI trainers who engage in conversations and provide the model with the correct responses. This phase refines the model's ability to generate contextually relevant and consistent responses in a conversational environment.

3. Reinforcement learning from human responses (RLHF).

The final phase consists of reinforcement learning, where the model is further refined using a method known as Reinforcement Learning with Human Feedback (RLHF). In this phase, AI trainers interact with the model and the responses generated by ChatGPT are ranked based on their quality. This ranking forms a reward model that guides the reinforcement learning process. By using the feedback loop, the RLHF method helps to minimize any generation of text deemed detrimental, biased or false by the model as could happen with previous GPTs. During this phase, multiple iterations of feedback and training are performed to continuously improve model performance.

The dataset used to train ChatGPT surprised the entire scientific community with its comprehensiveness. Thanks to the RLHF, it included a rich conversational dataset specifically selected to help learn the nuances of human dialogue. The training data underwent preprocessing using tokenization and normalization techniques to ensure that it was in a format suitable for training. Tokenization decomposes the text into smaller units (tokens), and normalization ensures consistency in the text representation, which is crucial for training a robust model.

In addition, the creators of ChatGPT employed a reward model to reinforce learning, which is integral to the reinforcement learning phase. This model is built from evaluations by AI instructors who interact with ChatGPT, rate responses, and provide valuable feedback. This iterative feedback mechanism is critical to refining the model and generating higher quality, more accurate and more confident responses over time.

The ChatGPT training process was meticulously designed to equip the model with a broad understanding of the language, refine its interaction capabilities, and finally fine-tune its responses based on human feedback to ensure that its results were useful, safe, and of high quality.

What can you do with an LLM once trained?

Once an LLM has been trained, they can be fine-tuned for a wide range of NLP tasks, including:

  • Creation of chatbots such as ChatGPT.

  • Generation of texts for product descriptions, blog posts and articles.

  • Answer frequently asked questions (FAQ) and direct customer inquiries to the most appropriate person.

  • Analyze customer feedback from emails, social media and product reviews.

  • Translate business or conversational content into different languages (although under-represented languages have a much lower quality than well-resourced languages and translation is much slower and more expensive than with neural networks).

  • Classify and categorize large volumes of text data for more efficient processing and analysis.

Chinchilla and the sweet spot for LLM training

The "Chinchilla" document [1], is a significant contribution to the field of AI and LLM development and offers interesting perspectives on LLM training. Experiments seem to indicate that there is an "optimal point" for training LLMs and that beyond this point, investing more resources in training in the form of more parameters does not necessarily lead to a proportional increase in performance. The paper emphasizes that it is not only the size of a model that influences its performance, but, as with neural network-based translation models, it is the quality of the data and the amount of data used that is important.

The authors of the paper found that, for computationally optimal training, the model size and the number of training tokens should scale equally: for every doubling of the model size, the number of training tokens should also double.

To test this hypothesis, they trained Chinchilla, a 70 billion parameter model trained with 1.4 trillion American tokens. Despite being much smaller than Gopher, as we can see in the table below, Chinchilla outperforms Gopher in almost all evaluations, including language modeling, question answering, common sense tasks, etc.

Imagen 7, Datos de entrenamiento de Chinchilla. Cortesía de Bing Image Creator

Image 7, Chinchilla training data. 

Let's clarify concepts: Do LLMs hallucinate?

In a sense, LLMs do "hallucinate" because they have been trained with large amounts of text data, which may contain incorrect or biased information. When LLMs generate text, they may incorporate this incorrect or biased information into their responses. This can give the impression that LLMs are hallucinating, as they are generating information that is not real or not based in reality but in a categorical way that can mislead the user into believing that they have the correct answer.

LLMs may freak out because they have been trained with large amounts of text and code data that, despite applying various cleaning filters, may contain incorrect or biased information. In fact, almost all efforts during the application of reinforcement learning with human feedback, evaluations and testing are aimed at avoiding the production of unsafe or unhelpful text, as described in Meta's article on LlaMa2 or OpenAI's article on ChatGPT.

All LLMs use CommonCrawl and various Internet sources as their base material for training and learning. Despite the processes of cleaning and elimination of bias, it is impossible to verify all information when dealing with terabytes of text. Therefore, an LLM has a "cut-off date" or "date of last known", although efforts are being made to improve responses with more up-to-date information including results from the web.

Imagen 8, Los LLMs pueden alucinar. Cortesía de Bing Image Creator

Image 8, LLMs can freak out. Courtesy of Bing Image Creator 

For example, an LLM could be trained with a text dataset containing incorrect or outdated information about the weather. The dataset might say that the average temperature in a country is 20°C. When the LLM was asked about the climate in that country, he or she might respond that the average temperature is 20ºC. This would be a hallucination because the real average temperature in that country (let's take Spain as an example) is 17 degrees.

LLMs can also hallucinate because, let's not forget, they are trained to be creative and "generative". All the other capabilities (how to write code or translate) are capabilities that have appeared unintentionally as a consequence of linguistic pattern recognition on huge amounts of text.

When an LLM is presented with a new question, he or she may generate an answer that is new and interesting but nevertheless may not be accurate or consistent with the real world. In fact, early criticisms of ChatGPT earlier this year focused on being a “stochastic parrot ”.

For example, an LLM might be trained on a text dataset containing information about the history of Spain. The dataset might say that Spain was founded by a group of people who came from Africa. When the LLM is asked about the history of Spain, it might respond that Spain was founded by a group of people who came from Africa. This would be a hallucination because the real history of Spain is much more complex.

In addition, LLMs may be prone to generate responses that are creative or imaginative. This is because LLMs are trained to generate text that is similar to text that has been presented to them in the training dataset. If the training dataset contains creative or imaginative text, LLMs may be prone to generate similar text. This could give the impression that the LLMs are hallucinating, as they are generating information that is not real. However, it is important to keep in mind that LLMs are not conscious beings. They do not have the ability to experience reality in the same way that humans do. The information that LLMs generate is simply a function of the data they have been trained on.

The famous attention window

The attention window is a fundamental concept in large language models (LLMs) that defines the scope of tokens that an LLM can refer to when generating the next token. This window determines the amount of context that an LLM can consider when generating text, which facilitates the understanding of long-range dependencies in text.

In their early days, LLMs had attention windows of only a few tokens. For example, in the days of statistical machine translation, the attention window was reduced to a few n-grams (words). With neural machine translation, the attention window was extended to a whole sentence, gaining a lot of fluency. ChatGPT and LLMs in general have increased the attention window to about 64,000 tokens (over 50,000 words), which is the size of a doctoral dissertation.

Imagen 9, Las ventanas de atención desde la traducción automática estadística a la neuronal a los LLMs. Presentación de Pangeanic en la Universidad de Surrey (Convergence Lectures), OCtubre 2023.

Image 9, Attention windows from statistical to neural machine translation to LLMs. Pangeanic presentation at the University of Surrey (Convergence Lectures), October 2023. 

The increased attention window in modern LLMs has had a significant impact on text generation, improving performance on a variety of tasks such as language modeling, question answering, and translation.

The growth of the attention window has also affected the level of coherence in the generated text. Early LLMs tended to produce text with local consistency (as was the case with statistical and neural translation), but modern LLMs are able to generate document-wide, very globally consistent text. This is because modern LLMs can consider a much larger amount of context, which allows them to better understand the subject matter of the text they are generating.

The size of the attention window can significantly affect text generation:

  • A small attention window can lead to repetitive or contextually meaningless text. This is because the LLM cannot consider enough context to generate coherent text.

  • A large attention window can generate more contextually relevant, informative, creative and original text. This is because the LLM can consider a much larger amount of context, allowing him or her to generate more accurate and complete text. However, an excessively large attention window could overwhelm the LLM, which could slow down text generation or produce incoherent text. The optimal size of the attention window depends on the specific task. For example, language modeling tasks may benefit from a smaller window, while question answering or translation tasks may require a larger window.

LLMs and Generative AI are not the same thing

It is critical to distinguish between LLMs and generative AI. While LLMs focus on text, generative IA encompasses a broader, multimodal spectrum, including the creation of images, music and more. All LLMs can be considered part of generative AI, but not all generative AI is an LLM.

As an example, Anthropic's Claude2, Google's PaLM, and the famous ChatGPT or LlaMa2 are LLMs, while Stable Diffusion or Microsoft´s Bing Image Creator, based on Dall-e 3, are Generative AI but produce images, not large language models.

Examples of popular large language models

As we have been saying, LLMs have become an essential tool for a wide range of applications, from customer service to scientific research. Some examples of popular large language models include:

  • ChatGPT: a generative artificial intelligence chatbot developed by OpenAI.

  • PaLM: Google's Pathways Language Model (PaLM), a transformer language model capable of performing arithmetic and common sense reasoning, explaining jokes, generating code and translating.

  • BERT: The Bidirectional Encoder Transformer Representation Language Model (BERT) was also developed at Google. It is a transformer-based model that can understand natural language and answer questions.

  • XLNet: a permutation language model, XLNet generated output predictions in a random order, which distinguishes it from BERT. It evaluates the pattern of encoded tokens and then predicts the tokens in random order, rather than in a sequential order.

  • GPT: Pre-trained generative transformers are perhaps the best known large language models. Developed by OpenAI, GPT is a popular foundational model whose numbered iterations are improvements of its predecessors (GPT-3, GPT-4, etc.).

A comprehensive look at the use of LLMs, benefits and challenges

After a few months of genuine shock and awe from the tech giants in late 2002 and early 2023, large language models (LLMs) have become a key pillar of virtually every industry. These models, part of the technological cutting edge, are redefining how machines interact with humans and how they process language... and even how we humans interact with each other with machine measurement.

Versatile LLM applications

  • Information Retrieval: Platforms such as Google and Bing rely heavily on LLMs. These models not only retrieve data in response to a query, but can also summarize and present the information in an understandable and readable way.

  • Sentiment analysis: Companies, especially marketing and public relations firms, employ LLMs to assess the sentiment of user opinions, providing valuable insights about products or services.

  • Text and code generation: LLMs, such as ChatGPT, can create content from scratch. From composing poetry to writing code snippets, the versatility of these models is astounding.

  • Chatbots and conversational AI: LLMs have revolutionized customer service, allowing bots to understand and respond to user queries more naturally and effectively.

LLMs in various sectors

Great language models have the potential to change the way many industries operate, making it more efficient for professionals to do their jobs. For now, they have already brought about radical changes to the world as we knew it.

  • Technology: Beyond search engines, developers use LLM to assist in coding and solve complex problems.

  • Health and science: LLMs contribute to medical progress by interpreting genetic information and assisting in disease research. They can also act as virtual medical assistants.

  • Legal, financial and banking sector: Lawyers and financial experts are beginning to harness the power of LLMs to search for information and detect patterns, which is useful for fraud detection or interpretation of laws.

Advantages of LLM

The advantages that LLMs offer to society, despite the fact that they are not "thinking beings" and lack reasoning abilities, are numerous.

Very broad spectrum of application: Its versatility ranges from language translation to the solution of complex mathematical problems.

Continuous improvement and learning: As more data are introduced, their accuracy and performance improve. LLMs are constantly learning, adapting to new contexts.

Fast learning: With "learning in context", LLMs can adapt quickly to new tasks without requiring extensive training.

Challenges and limitations

  • Hallucinations: As we discussed above, LLMs can sometimes generate inappropriate or incorrect responses that do not reflect reality or the user's intent.

  • Security and bias: LLMs can be manipulated to disseminate false or biased information. In addition, data integrity and privacy is a constant concern.

  • Consent and copyright: There are concerns about how training data is obtained and used, as many companies have had their web data used without their permission. This includes potential problems with plagiarism and copyright infringement. Some companies have started to put "anti-crawl clauses" in the robots.txt file for ChatGPT /OpenAI so that they do not exploit the publication of information on their sites.

  • Scaling and deployment: LLMs are complex and require considerable infrastructure and advanced technical expertise to implement and maintain.

Large language models are redefining the intersection between technology and language. With immense potential to enhance and facilitate human-machine interaction, LLMs continue to advance and will continue to advance by leaps and bounds, possibly being a piece of the puzzle towards artificial general intelligence (AGI), the real goal of Sam Altman, CEO of OpenAI. As such, it is essential to address its challenges to ensure that this technology benefits society in an ethical and responsible manner.

Large Language Model (LLM) use cases now and in the future

According to Gartner, there is a wide variety of use cases across numerous industries for Large Language Models and their potential application scope continues to expand steadily. Here are some current and potential use cases for LLMs:

Current Use Cases:

  1. Natural Language Processing (NLP): LLMs can be used in NLP tasks such as text classification, sentiment analysis, named entity recognition, machine translation and speech recognition.

  2. Chatbots and virtual assistants: LLMs power chatbots and virtual assistants, enabling them to understand and respond to user queries, thereby improving customer service and reducing support costs.

  3. Language translation: LLMs are used in machine translation platforms, enabling faster and more accurate translations, breaking down language barriers and facilitating cross-cultural communication.

  4. Text summarization: LLMs can condense lengthy texts into concise and meaningful summaries, saving users time and improving comprehension.

  5. Sentiment analysis in text: LLMs analyze sentiment in text data, helping companies assess customer opinions, identify trends and make informed decisions.

  6. Content generation: LLMs generate high-quality content, such as articles, blog posts and social media posts, decreasing the need for human writers and streamlining content creation processes.  

  7. Answers to questions: LLMs answer questions based on the information they were trained with, providing quick answers to common queries and freeing up human resources for more complex tasks.

  8. Code generation: LLMs generate code snippets, automating certain programming tasks and speeding up software development cycles. 

  9. Legal Document Review: LLMs review legal documents, identify relevant clauses, highlight inconsistencies and simplify the contract review process.

  10. Medical Diagnosis: LLMs assist physicians in diagnosing diseases by analyzing medical records, identifying patterns and suggesting possible treatments.

Future Use Cases:

  1. Enhanced conversational AI: LLMs will continue to refine conversational AI capabilities, enabling more sophisticated dialogues between humans and machines, and blurring the lines between human and AI interactions.

  2. Emotion recognition: LLMs will become adept at recognizing emotions from voice, text and visual inputs, enabling empathetic responses and improved human-AI collaboration.

  3. Explainable AI (XAI): LLMs will provide clear explanations of their decision-making processes, fostering trust and accountability in AI-driven choices.

  4. Ethical Decision Making: LLMs will integrate ethical considerations into their decision-making frameworks, ensuring fairness, transparency and compliance with moral principles.

  5. Creative Writing and Writing: LLMs will venture into creative writing, generating original stories, poems and scripts, and potentially disrupting traditional art forms.

  6. Speech-to-text and text-to-speech conversion: LLMs will improve speech-to-text and text-to-speech conversion capabilities, improving accessibility for people with disabilities and closing language gaps.

  7. Multimodal communication: LLMs will process and generate multimodal content, combining text, images, video and audio to create richer and more engaging experiences.

  8. Edge AI: LLMs will be deployed in devices at the edge, enabling localized processing, reducing latency and increasing security for IoT and mobile applications.

  9. Transfer learning: LLMs will adapt to new domains and tasks through transfer learning, maximizing the value of pre-trained models and minimizing the need for task-specific training data.

  10. Hybrid Intelligence: LLMs will collaborate with Symbolic Artificial Intelligence systems, integrating rule-based reasoning and deep learning insights, to achieve unprecedented levels of performance and efficiency.

In summary, as these models become larger and more complex, they are expected to be able to perform even more complex tasks and in addition to the above points, some of the possible future developments could also include:

  • The ability to understand and generate natural language more naturally and fluently.

  • The ability to learn and adapt to new tasks more quickly and efficiently.

  • The ability to generate different creative text formats, such as poems, code, scripts, musical pieces, e-mail, letters, etc.

These advances in LLMs will revolutionize various sectors, transforming the way we interact, work and live. However, it is crucial to address the ethical implications, ensuring responsible development and implementation of AI that benefits society as a whole.

Social implications of large language models

LLMs have the potential to transform human society in many ways. For example, they could be used to improve customer service, education, scientific research and creativity.

However, LLMs also raise some social concerns. For example, there is a risk that they may be used to create false or misleading content, or to manipulate people.

Conclusions: Large language models are an emerging technology with great potential. As these models continue to evolve, they are likely to play an increasingly important role in our lives.

Some pending challenges

Despite their potential, LLMs also present some outstanding challenges. One of the main challenges is bias. LLMs are trained on large text data sets, which may be biased.

This can lead to LLMs generating text that is also biased. Another challenge is security. LLMs can be used to create harmful content, such as hate speech or propaganda. It is important to develop security measures to protect against the misuse of LLMs.

Overall, LLMs are a promising technology with great potential to improve our lives. However, it is important to be aware of the remaining challenges so that we can develop this technology responsibly.

We cannot end this article without mentioning Yann LeCun, META's chief engineer and responsible for many open source models that the community is working on, adopting his models such as NLLB, SeamlessM4T or Llama2 on which to build AI solutions:

"One thing we know is that if future AI systems are built on the same model as today's autoregressive LLMs, they may become very knowledgeable, but they will still be dumb.

They will continue to hallucinate, they will continue to be difficult to control, and they will continue to just regurgitate things they have been trained to do.

MOST IMPORTANTLY, they will remain incapable of reasoning, inventing new things or planning actions to meet objectives.

And unless they can be trained from video, they will still not understand the physical world.

The systems of the future will "have" to use a different architecture, capable of understanding the world, reasoning and planning to meet a set of objectives and guardrails.

These target-oriented architectures will be secure and remain under our control because "we" set their targets and guardrails and they cannot deviate from them.

They will not want to dominate us because they will not have any goals that drive them to dominate (unlike many living species, particularly social species such as humans). In fact, barrier goals will prevent it.

They will be smarter than us, but they will remain under our control.

They will make us "smarter".

The idea that intelligent AI systems will necessarily dominate humans is wrong.

Instead of multiplying today's systems 100-fold, which will lead nowhere, we need to make these target-based AI architectures work."

- Yann LeCun VP de AI Meta

 

Sources:

[1] How Does Llama-2 Compare to GPT-4/3.5 and Other AI Language Models https://www.promptengineering.org/how-does-llama-2-compare-to-gpt-and-other-ai-language-models/

[2] Llama 2 is about as factually accurate as GPT-4 for summaries and is 30X cheaper https://www.anyscale.com/blog/llama-2-is-about-as-factually-accurate-as-gpt-4-for-summaries-and-is-30x-cheaper

[3] The Battle for AI Brilliance! Llama 2 vs. ChatGPT | by Stephen - Medium https://weber-stephen.medium.com/unleashing-the-ultimate-ai-battle-llama-2-vs-chatgpt-gpt-3-5-a-creative-showdown-9919608200d7

[4] 6 main differences between Llama 2, GPT-3.5 & GPT-4 - Neoteric https://neoteric.eu/blog/6-main-differences-between-llama2-gpt35-and-gpt4/

[5] Fine-tune your own Llama 2 to replace GPT-3.5/4 | Hacker News https://news.ycombinator.com/item?id=37484135

[6] GPT-3.5 is still better than fine tuned Llama 2 70B (Experiment using prompttools) - Reddit https://www.reddit.com/r/OpenAI/comments/16i1lxp/gpt35_is_still_better_than_fine_tuned_llama_2_70b/