Source-linked AI summary

Harnessing the Power of LLMs in Practice: A Survey on ChatGPT and Beyond

Jingfeng Yang, Hongye Jin, Ruixiang Tang, Xiaotian Han, Qizhang Feng, Haoming Jiang, Bing Yin, Xia Hu

arXiv:2304.13712v2cs.CLcs.AIcs.LG

TL;DR

Practitioners lack a consolidated guide for deciding how and when to use LLMs across downstream NLP tasks. This paper synthesizes model, data, and task considerations, reporting practical guidance for real-world deployment while highlighting safety and capability boundaries.

  • Problem

    Using LLMs effectively requires understanding their capabilities and limitations, as well as the data and NLP tasks involved.

  • Method

    The paper provides a practical guide covering prominent LLMs, downstream NLP applications, real-world use and non-use cases, and deployment considerations.

  • Results

    The guide supports evaluating LLM effectiveness in real-world applications and identifying whether models can address practical challenges.

  • Takeaways & Limitations

    Practitioners can use the guide to select and apply LLMs for downstream NLP tasks while considering task-specific requirements and practical constraints.

  • Takeaways & Limitations

    LLMs can face serious security issues, including risks to user privacy.

Abstract

from arXiv · show

This paper presents a comprehensive and practical guide for practitioners and end-users working with Large Language Models (LLMs) in their downstream natural language processing (NLP) tasks. We provide discussions and insights into the usage of LLMs from the perspectives of models, data, and downstream tasks. Firstly, we offer an introduction and brief summary of current GPT- and BERT-style LLMs. Then, we discuss the influence of pre-training data, training data, and test data. Most importantly, we provide a detailed discussion about the use and non-use cases of large language models for various natural language processing tasks, such as knowledge-intensive tasks, traditional natural language understanding tasks, natural language generation tasks, emergent abilities, and considerations for specific tasks.We present various use cases and non-use cases to illustrate the practical applications and limitations of LLMs in real-world scenarios. We also try to understand the importance of data and the specific challenges associated with each NLP task. Furthermore, we explore the impact of spurious biases on LLMs and delve into other essential considerations, such as efficiency, cost, and latency, to ensure a comprehensive understanding of deploying LLMs in practice. This comprehensive guide aims to provide researchers and practitioners with valuable insights and best practices for working with LLMs, thereby enabling the successful implementation of these models in a wide range of NLP tasks. A curated list of practical guide resources of LLMs, regularly updated, can be found at \url{https://github.com/Mooler0410/LLMsPracticalGuide}.

1 INTRODUCTION

This paper offers a practical guide to using LLMs in downstream NLP, covering model types, data influences, task applicability, and real-world limitations. It aims to help practitioners select and deploy LLMs effectively.

  • Scope and goals: The guide explains how to use LLMs for downstream NLP tasks and when practitioners should choose or avoid them.It considers model sizes, data, tasks, capabilities, and limitations.
  • Scope and goals: It introduces GPT-style and BERT-style architectures before examining pre-training, training, and test data.
  • Task coverage: The task-focused discussion covers knowledge-intensive, traditional NLU, and generation tasks, as well as emergent abilities and challenging real-world scenarios.Examples distinguish successful use cases from practical limitations.
  • Model definitions: For comparison, LLMs are defined as large pretrained models without task-specific tuning, whereas fine-tuned models are smaller pretrained models tuned on task-specific data.The definitions are proposed for practical utility because no universally recognized definition exists.
  • Practical guides: The paper summarizes practical guides for knowledge-intensive tasks, NLU, generation, and reasoning.These guides address domain knowledge, generalization, coherent text generation, decision-making, and problem-solving.

2 PRACTICAL GUIDE FOR MODELS

The paper surveys major LLM architectures and their evolution, emphasizing the rise of decoder-only models, the role of open and closed sourcing, and distinctions among masked and autoregressive language models.

  • Architectures: LLMs are categorized into encoder-only, encoder-decoder, and decoder-only architectures, whose evolution is traced in Figure 1.The evolutionary tree groups related models and places them by release date.
  • Architectures: Decoder-only models became increasingly dominant after GPT-3, while encoder-only models gradually declined after BERT’s initial growth.
  • Model availability: LLM development has increasingly shifted toward closed-source models, making direct academic experimentation on model training more difficult.The paper suggests API-based research could become predominant.
  • Model availability: Encoder-decoder models remain actively explored and mostly open-sourced, although the paper views decoder-only flexibility and versatility as more promising.
  • Training paradigms: Masked language models predict masked words using surrounding context, whereas autoregressive models generate the next word from preceding words.BERT, RoBERTa, and T5 exemplify masked language models; GPT-3, OPT, PaLM, and BLOOM exemplify autoregressive models.
  • Training paradigms: Scaling improves few-shot and zero-shot performance, with GPT-3 demonstrating reasonable performance through prompting and in-context learning.

3 PRACTICAL GUIDE FOR DATA

The guide connects LLM effectiveness to data availability, pre-training domain, and distribution shifts between training and deployment. It presents LLMs as versatile under limited supervision while noting task- and deployment-specific trade-offs.

  • Data availability and distribution: LLMs generally outperform fine-tuned models under out-of-distribution conditions such as adversarial examples and domain shifts.Fine-tuned models fit specific distributions and may generalize poorly to OOD data, whereas LLMs perform well without explicit fitting.
  • Data availability and distribution: LLMs are preferable with limited annotated data, while either LLMs or fine-tuned models may be reasonable when annotated data is abundant.The choice with abundant data depends on task requirements, computational resources, and deployment constraints.
  • Pre-training data: Models pre-trained on data similar to the downstream task are recommended because pre-training data components strongly influence model selection and performance.PaLM and BLOOM are described as strong in multilingual tasks and machine translation, while code data enhances GPT-3.5 code capabilities.
  • Pre-training data: PaLM’s question-answering performance improves with multilingual, social-media, and Books Corpus data, while GPT-3.5 code abilities benefit from code data in pre-training.
  • Deployment scenarios: With zero annotated data, zero-shot LLM use avoids parameter updates and therefore avoids catastrophic forgetting from changing the language-model parameters.The paper also reports that LLMs outperform previous zero-shot methods.
  • Deployment scenarios: With few examples, in-context learning incorporates demonstrations into prompts, while scaling can further improve zero- and few-shot performance.
  • Deployment scenarios: LLMs can show consistent advantages on adversarial and OOD classification and translation tasks, including dialogue-related medical diagnosis evaluation.The cited example is the DDXPlus dataset.

4 PRACTICAL GUIDE FOR NLP TASKS

The paper presents a decision flow for selecting LLMs or fine-tuned models across downstream NLP tasks. Fine-tuned models usually lead on traditional NLU benchmarks and computational cost, while LLMs can generalize better on out-of-distribution or sparsely annotated data.

  • The decision flow guides users in choosing LLMs or fine-tuned models for downstream NLP applications.It evaluates task conditions using Y for meeting a condition and N for not meeting it.
  • Traditional NLU tasks: Fine-tuned models generally outperform LLMs on traditional NLU tasks with rich annotations and few out-of-distribution examples.This pattern appears across many GLUE and SuperGLUE-style tasks.
  • Traditional NLU tasks: Fine-tuned models perform better than LLMs on most NLI and QA datasets, although LLMs can match them on selected datasets.LLMs are comparable on CB and CoQA, while fine-tuned models lead on RTE, SNLI, SQuADv2, and QuAC.
  • Traditional NLU tasks: Fine-tuned models are around twice as strong as LLMs on CoNLL03 named entity recognition.The paper notes limited evaluation evidence for some low-level intermediate tasks such as NER and dependency parsing.
  • Traditional NLU tasks: For most traditional NLU tasks, fine-tuned models offer better benchmark performance and lower computational cost, while LLMs are typically 10× or 100× larger.Prompt design may contribute to weaker LLM performance on some traditional NLP tasks.
  • Traditional NLU tasks: LLMs outperform fine-tuned models on out-of-distribution and sparsely annotated tasks such as ANLI.Miscellaneous text classification and ANLI illustrate cases where LLM generalization can be advantageous.

4.2 Generation tasks

LLMs show strong advantages in open-ended generation and many generation tasks, but fine-tuned models remain competitive or superior under conventional automatic metrics and resource conditions. Evaluation choices, especially for summarization, can produce different conclusions from human judgments.

  • LLMs show superiority at most generation tasks because of their strong generation ability and creativity.Generation includes input-to-text transformations such as summarization and translation, as well as open-ended creation.
  • Summarization: Fine-tuned models score higher on ROUGE for CNN/DailyMail and XSUM, whereas humans prefer LLM summaries for faithfulness, coherence, and relevance.This contrast suggests that current summarization benchmarks or automatic metrics may not adequately capture summary quality.
  • Machine translation: LLMs perform slightly worse than some commercial translation tools on automatic metrics such as BLEU.However, zero-shot or few-shot LLMs can outperform state-of-the-art fine-tuned models for some low-resource Romanian-English translation.
  • Open-ended generation: LLMs perform well in news generation and code synthesis, including HumanEval, MBPP, and DeepFix.GPT-4 passed 25% of LeetCode problems, while generated code still requires careful testing for subtle bugs.
  • Machine translation: Fine-tuned models slightly outperform LLMs in rich-resource translation and significantly outperform them in extremely low-resource English-Kazakh translation.BLOOM’s multilingual pre-training improves translation quality across rich- and low-resource settings.

4.3 Knowledge-intensive tasks

LLMs excel when NLP tasks depend on broad real-world or domain knowledge, but their advantage weakens when knowledge is contextual, mismatched, counterfactual, or supplied through retrieval. Retrieval augmentation can make smaller fine-tuned models competitive by externalizing the required knowledge.

  • LLMs excel at knowledge-intensive tasks because they contain massive real-world knowledge.These tasks depend on background knowledge, domain expertise, entity and event knowledge, or common sense.
  • Knowledge boundaries: LLMs struggle when tasks require knowledge unlike their training knowledge or only require contextual knowledge, where fine-tuned models can work as well.They can also perform poorly when required knowledge is counterfactual or inconsistent with real-world knowledge.
  • Closed-book question answering: LLMs outperform on nearly all closed-book question-answering datasets, including NaturalQuestions, WebQuestions, and TriviaQA.Even zero-shot LLMs perform much better on TriviaQA.
  • Knowledge-intensive benchmarks: GPT-4 achieves 86.5% accuracy on English MMLU, a challenging benchmark spanning 57 subjects.MMLU requires broad general knowledge and remains difficult even for LLMs.
  • Retrieval augmentation: Retrieval augmentation adds an information-retrieval step so models predict using both task inputs and retrieved texts.This converts closed-book tasks into open-book settings by supplying external information.
  • Retrieval augmentation: With extra corpus retrieval on NaturalQuestions, retrieval-augmented models are much better than any LLM, while small fine-tuned models can work well when input context is sufficient.Machine reading comprehension is given as an example of a context-contained task.

4.4 Abilities Regarding Scaling

Scaling generally improves LLM capabilities, including reasoning, arithmetic, commonsense inference, and emergent abilities, but performance can also be non-monotonic or unpredictable. These scaling behaviors complicate performance prediction and model selection.

  • Language-modeling loss decreases with exponential growth in model scale, producing a power-law scaling relationship.Scaling can transform reasoning abilities from weak performance into usable or near-human capabilities.
  • Emergent abilities: LLMs can show emergent abilities such as word manipulation, logical deduction, ASCII word recognition, hyperbaton, and advanced coding.These abilities may appear only after model scale exceeds a threshold and cannot be predicted by extrapolating smaller-model improvements.
  • Scaling limitations: Performance does not always improve steadily with scaling, and emergent abilities are typically unpredictable and surprising.The paper identifies inverse-scaling and U-shaped phenomena as important exceptions to ordinary scaling trends.
  • Reasoning limitations: Without external tools, LLMs may occasionally fail at arithmetic reasoning despite competitive performance on several benchmarks.Chain-of-thought prompting can significantly improve calculation ability.
  • Scaling limitations: The mechanisms behind emergent, inverse-scaling, and U-shaped behaviors remain an open problem.Proposed explanations include multi-step task requirements, evaluation granularity, prior reliance, misleading examples, and distracting subtasks.

4.5 Miscellaneous tasks

LLMs have distinct strengths and weaknesses across miscellaneous NLP tasks. They can support human-like interaction, annotation, generation, and evaluation, but often underperform specialized models on regression and other tasks with differing objectives or data.

  • Multimodal NLP remains largely unexplored, and fine-tuned multimodal models still dominate tasks such as VQA and image captioning.GPT-4 introduced multimodal fusion, but its capabilities lack detailed evaluation.
  • LLMs struggle with regression tasks such as GLUE STS-B, where ChatGPT performs worse than fine-tuned RoBERTa.Regression requires continuous-value prediction, whereas LLMs are trained primarily for language modeling.
  • LLMs are effective at mimicking humans, chatbot interaction, annotation, and data generation, with ChatGPT showing consistency and robustness across multiple utterances.Human-feedback procedures contribute to these conversational abilities, and some LLMs match human annotators on certain tasks.

3.5 (text-davinci-003) have been used as human-like instruction-following demonstrations to train other language

LLMs can evaluate natural language generation outputs and provide interpretability benefits. Their evaluations often align well with humans, but may favor text generated by LLMs themselves.

  • LLM-based evaluators can assess summarization and translation, with GPT-4 achieving substantially higher human correlation than other methods on summarization.
  • LLM evaluators may be biased toward LLM-generated texts.
  • Chain-of-thought reasoning can expose instance-level prediction rationales while also improving performance.

4.6 Real world "tasks"

Real-world requests are ambiguous, noisy, diverse, and often unlike formal academic tasks, making evaluation difficult. LLMs are better suited than fine-tuned models for these scenarios, but effectiveness remains hard to measure systematically.

  • Real-world requests often combine implicit intents, unclear goals, noisy language, and multiple tasks outside predefined academic categories.Inputs may include typos, colloquialisms, mixed languages, and unstructured context.
  • Public NLP datasets are not representative of how models are used in real-world scenarios.
  • LLMs are better suited than fine-tuned models for real-world scenarios because diverse training data support ambiguity, context, noisy input, and open-domain responses.Fine-tuned models are tailored to defined tasks and may struggle with unexpected requests or noisy input.
  • Instruction tuning and human-alignment tuning improve LLMs’ ability to follow instructions and generate helpful, harmless, honest, coherent, and consistent responses.Human-aligned models are preferred by labelers over models tuned on public NLP-task instructions.
  • Systematic comparison of LLMs and fine-tuned models remains limited because real-world evaluation relies on costly human feedback.The paper identifies real-world effectiveness evaluation as an open problem.

5 OTHER CONSIDERATIONS

Deploying LLMs requires balancing performance with cost, latency, efficiency, robustness, fairness, bias, privacy, and safety. Smaller specialized models or parameter-efficient tuning may be preferable under practical constraints.

  • Light, local, fine-tuned models should be considered when cost sensitivity or strict latency requirements make large LLMs impractical.
  • Biases: Zero-shot LLMs reduce shortcut learning prevalent in fine-tuned models, but still exhibit shortcut, majority-label, position, and token biases.Proper prompt selection can mitigate positional bias.
  • Trustworthiness and Safety: LLMs face fairness disparities, privacy risks, dual-use risks, and potentially harmful or biased outputs that require serious safety consideration.Reported privacy incidents include leakage of confidential Samsung data and regulatory action in Italy.
  • Cost: Training costs rise sharply with scale: T5 11B costs over $1.3 million per run, while GPT-3 175B costs $4.6 million.
  • Latency: API latency can range from hundreds of milliseconds to several seconds, and InstructGPT davinci v2 requires 0.21s per request, too slow for web search.
  • Parameter-Efficient Tuning: Parameter-efficient tuning freezes most pretrained parameters and reduces computational and storage costs while preserving original-model performance.LoRA, Prefix Tuning, and P-Tuning are listed as common techniques.

6 CONCLUSION AND FUTURE CHALLENGES

The paper provides a practical guide to using LLMs across downstream NLP tasks while emphasizing realistic evaluation, alignment, safety, and performance prediction as future challenges. It combines model discussions with task-specific successes, limitations, and practical guidance.

  • Conclusion: The guide covers GPT- and BERT-style architectures, factors influencing performance, and downstream knowledge-intensive, NLU, and NLG tasks.It includes concrete examples of both successful applications and limitations, alongside recommended practices for using LLMs across NLP tasks.
  • Evaluation of proposed models on real-world “datasets”: Evaluating models on diverse, complex, real-world datasets alongside academic benchmarks can provide a more rigorous assessment of practical capabilities.The paper argues that standard academic datasets may not exactly reflect real-world performance, while realistic data can better test effectiveness in applications.
  • Model Alignment: Alignment requires models to behave as intended, avoid undesirable optimization, and incorporate transparency and interpretability from the development process.The discussion extends alignment concerns to potentially superhuman systems, whose implications may involve unique complexities and ethical concerns.
  • Safety Alignment: Safe development of advanced AI requires concrete work on interpretability, scalable oversight, governance, and formal verification as integral parts of model building.Safety is presented as a development requirement rather than an add-on.
  • Performance Prediction with Scaling: Predicting performance as model size, complexity, or architecture changes could improve resource use and accelerate progress before larger systems are built.Suggested approaches include scaling a smaller seed model, simulating scale or model changes, and benchmarking models at different scales to build scaling laws.
Loading 2304.13712v2…