Home > Articles

This chapter is from the book

Generative AI and Language Models

One of the most exciting and challenging areas of generative technologies is natural language generation (NLG), which generates natural language text from a given input, such as an image, a keyword, or a prompt. NLG has many applications, including summarization, translation, dialogue, storytelling, and content creation. However, NLG also poses many technical and ethical challenges, such as ensuring the generated texts’ quality, diversity, coherence, and fairness.

A key component of NLG is the language model (LM), a probabilistic model that assigns a probability to a sequence of words or tokens. LMs can generate new texts by sampling tokens according to their probabilities or evaluating the likelihood of existing texts. LMs can be trained on large corpora of text data, such as Wikipedia, books, news articles, or social media posts, using deep learning techniques, such as RNNs or transformers.

Because statistical language models (SLMs) cannot capture long-term dependencies or semantic relations in natural language, this underscores the importance of building these models with responsibility and ethics in mind, as discussed throughout this book.

The development of LMs has gone through several stages, reflecting the advances in computational power, data availability, and algorithmic innovation. There are four main development stages of LMs: statistical language models, neural language models, pre-trained language models, and large language models (LLMs).4

  • Statistical language models are based on statistical learning models. The idea is to build models based on the n-gram assumption, which states that the probability of a word only depends on the previous n-1 words and not on the rest of the sentence or the document. An n-gram is a sequence of n-words, such as “the cat” or “a big house.” For instance, predicting when the probability of the word “model” would come after the words “large language” is illustrated as P(model|large language). Statistical language models estimate the probabilities of n-grams from a corpus of text data using techniques such as counting, smoothing, or interpolation.

    • Counting: Counting is simply the frequency of the n-gram in the corpus divided by the total number of n-grams.

    • Smoothing: Smoothing adds some small values to the counts to avoid zero probabilities for unseen n-grams.

    • Interpolation: Interpolation combines the probabilities of different n-grams, such as unigrams, bigrams, and trigrams, to balance the trade-off between specificity and generality.

Smoothing and interpolation are often adopted to mitigate the data sparsity problem. Statistical language models are simple and efficient but have limited expressive power and cannot capture long-term dependencies or semantic relations in natural language. For example, statistical language models cannot distinguish between the meanings of “bank” in “I went to the bank” and “The bank was closed” or the contexts of “She saw a bear” and “She saw a bare.” Statistical language models cannot handle the ambiguity of words with multiple meanings, such as “bat,” “right,” or the influence of words that are far apart in the sequence, such as “The man who wore a hat” and “The hat was red.”

  • Neural language models (NLMs) use neural networks, such as recurrent neural networks (RNNs) or convolutional neural networks (CNNs), to learn distributed representations of words and sequences and to model the conditional probability of the next word given the previous words. A groundbreaking work in the field of neural language modeling was the paper “A neural probabilistic language model,”5 which presented the idea of representing words as continuous vectors in a high-dimensional space and learning the probability of the next word based on the sum of the context word vectors. Many studies have opened a new chapter for using language models for representation learning, playing an influential role in the NLP field. For example, word2vec6 utilizes two methods to learn word embedding:

    • Using context to predict a target word through CBOW (Continuous Bags of Words): CBOW is like a guessing game where the AI tries to predict a word based on the words around it. Imagine a sentence with a missing word; CBOW looks around the neighboring words to guess the missing one, helping the AI better understand the language.

    • Using a word to predict a target context through Skip-Gram: Skip-Gram is like a word puzzle where the challenge is to find the related words. Given a specific word, Skip-Gram tries to predict the surrounding words, helping the AI grasp the context and relationships between words in a sentence.7

      NLMs can overcome some of the limitations of statistical language models, such as capturing longer contexts and learning richer features, but they also have drawbacks, such as requiring more computation and data and suffering from the vanishing or exploding gradient problem.

  • Pre-trained language models (PLMs) are a type of model that uses transfer learning. PLMs are first trained on a large collection of text data that doesn't have specific labels (this is the pre-training phase). After this, PLMs are fine-tuned on a particular task or domain with more specific data (this is the fine-tuning phase). This process allows PLMs to be highly effective at understanding and generating human language in various applications. As mentioned earlier, RNNs have some drawbacks and limitations, such as the difficulty of learning long-term dependencies, the gradient vanishing or exploding problem, and the sequential nature of computation, which prevents parallelization and reduces efficiency. To address these issues, long short-term memory (LSTM) models were proposed by researchers as one of the most popular and effective variants of RNNs. LSTM models have a special structure consisting of three gates and a cell state, which can regulate the input, output, and forget operations of the recurrent unit. LSTM models can generate natural language texts by updating the cell state and the hidden state at each time step, based on the current input and the previous states, and then producing the next word or token from the hidden state. As one of the first models that demonstrated the effectiveness of PLMs on large-scale unlabeled text data and then transferring the learned knowledge to downstream tasks or domains, embeddings from language models (ELMo) was built as an LSTM-based model that can generate contextualized word embeddings, which are vector representations of words that capture their meanings and usage in different contexts. Unlike traditional word embeddings, such as word2vec or GloVe, which assigns a fixed vector to each word regardless of its context, ELMo can dynamically compute word embeddings based on the entire input sentence or document, using a bidirectional LSTM that encodes both the left and the right contexts of each word. PLMs also adopt the transformer architecture, which is an attention-based neural network that can learn long-range dependencies and parallelize computation. Some of the most influential PLMs are BERT, developed by Google, and GPT, developed by OpenAI. Based on pre-trained context-aware word representations, these models have shown remarkable effectiveness and versatility as general-purpose semantic features that can significantly improve the performance and efficiency of various NLP tasks.

  • Large language models (LLMs) are the latest and most advanced stage of LMs, which aim to build very large-scale and powerful LMs that can generate natural language texts across multiple domains and tasks, given minimal or no supervision. LLMs rely on massive amounts of computation and data and use sophisticated optimization and regularization techniques, such as self-attention, dropout, or layer normalization, to train billions or trillions of parameters. Some of the most prominent examples of LLMs are GPT-3, GPT-3.5 (Instruct GPT) GPT-4 and GPT-4o, developed by OpenAI.

    • GPT-3: GPT-3 is a transformer-based model with 175 billion parameters and can generate coherent and diverse texts on various topics and domains, given a few words or sentences as input.

    • GPT-3.5: In 2022, OpenAI deployed GPT-3.5, which performs more significantly in following instructions, making up facts less often, and generating less toxic output. They used prompts submitted by the customers through Playground and hired human annotators to provide demonstrations of the desired model behavior and rank outputs from the models. GPT-3.5 is fine-tuned based on this data from GPT-3.

    • GPT-4: In 2023, GPT-4, a 1.8T-parameter model with 16 Mixture of Experts (MoE), was announced by OpenAI to improve the security of the model and enable multimodal capability. However, LLMs also have limitations and risks, such as producing inaccurate, biased, or harmful content or violating the data sources’ privacy or intellectual property rights.

    • GPT-4o: Launched in 2024, GPT-4o (“o” for “omni”) is a step towards a much more natural human-computer interaction—it accepts any combination of text, audio, image, and video as input and generates any combination of text, audio, and image as output. It can respond to audio inputs in as little as 232 milliseconds, with an average of 320 milliseconds, which is similar to human response time in a conversation. It matches GPT-4 Turbo performance on text in English and code, with significant improvement on text in non-English languages, while also being much faster and 50% cheaper in the API. GPT-4o is especially better at vision and audio understanding compared to existing models.8

The emergence and advancement of LLMs significantly impact the AI community and society at large, as they open up new possibilities and challenges for natural language understanding and generation. LLMs can be seen as a form of generative technologies that can create novel and valuable outputs from minimal or no inputs, such as images, music, art, or texts. They can foster interdisciplinary collaboration and innovation by bringing together researchers and practitioners from different fields and domains and creating new paradigms and methods for natural language understanding and generation.

Despite the exciting progress and impact of LLMs and generative AI, many mysterious and unpredictable perspectives remain. There are some risks associated with LLMs. They can amplify existing biases and harms, such as perpetuating stereotypes, discrimination, misinformation, or manipulation, by learning from unfiltered and unrepresentative data sources, or by being misused or abused by malicious actors. They can also pose ethical and legal dilemmas, such as violating privacy, intellectual property, or human dignity, by exposing sensitive or personal information, infringing on copyrights or trademarks, or generating deceptive or harmful content. Moreover, they can challenge existing norms and values, such as accountability, transparency, or trust, by obscuring natural language generation’s sources, processes, and outcomes or by creating conflicts of interest, responsibility, or authority.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020