Source-linked AI summary

A Survey of Large Language Models

Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Xiaolei Wang, Yupeng Hou, Yingqian Min, Beichen Zhang, Junjie Zhang, Zican Dong, Yifan Du, Chen Yang, Yushuo Chen, Zhipeng Chen, Jinhao Jiang, Ruiyang Ren, Yifan Li, Xinyu Tang, Zikang Liu, Peiyu Liu, Jian-Yun Nie, Ji-Rong Wen

arXiv:2303.18223v19cs.CLcs.AI

TL;DR

Machines still struggle to understand and communicate in human language. This survey synthesizes recent LLM advances across pre-training, adaptation, utilization, and evaluation, while summarizing resources and future directions. It provides a reference for researchers and engineers developing LLMs.

  • Problem

    Enabling machines to read, write, and communicate like humans remains a longstanding challenge because they cannot naturally grasp human language.

  • Method

    The survey reviews LLM advances across pre-training, adaptation, utilization, and evaluation, and summarizes development resources and implementation guidance.

  • Results

    The survey identifies key techniques and findings underlying LLM success and consolidates recent literature into a reference resource.

  • Takeaways & Limitations

    Researchers and engineers can use the survey as a reference for developing and reproducing LLMs.

  • Takeaways & Limitations

    LLM evaluation results can be sensitive to prompts, test settings, and answer-parsing methods.

Abstract

from arXiv · show

Language is essentially a complex, intricate system of human expressions governed by grammatical rules. It poses a significant challenge to develop capable AI algorithms for comprehending and grasping a language. As a major approach, language modeling has been widely studied for language understanding and generation in the past two decades, evolving from statistical language models to neural language models. Recently, pre-trained language models (PLMs) have been proposed by pre-training Transformer models over large-scale corpora, showing strong capabilities in solving various NLP tasks. Since researchers have found that model scaling can lead to performance improvement, they further study the scaling effect by increasing the model size to an even larger size. Interestingly, when the parameter scale exceeds a certain level, these enlarged language models not only achieve a significant performance improvement but also show some special abilities that are not present in small-scale language models. To discriminate the difference in parameter scale, the research community has coined the term large language models (LLM) for the PLMs of significant size. Recently, the research on LLMs has been largely advanced by both academia and industry, and a remarkable progress is the launch of ChatGPT, which has attracted widespread attention from society. The technical evolution of LLMs has been making an important impact on the entire AI community, which would revolutionize the way how we develop and use AI algorithms. In this survey, we review the recent advances of LLMs by introducing the background, key findings, and mainstream techniques. In particular, we focus on four major aspects of LLMs, namely pre-training, adaptation tuning, utilization, and capacity evaluation. Besides, we also summarize the available resources for developing LLMs and discuss the remaining issues for future directions.

1 INTRODUCTION

Language models evolved from statistical and neural approaches to pre-trained and large language models, whose scaling enables broader task-solving capabilities and emergent abilities. This survey reviews how LLMs are developed, adapted, used, and evaluated while outlining their impact, challenges, and supporting resources.

  • Large language models: Scaling PLMs to very large sizes can produce emergent abilities absent from smaller models, such as GPT-3’s few-shot in-context learning, motivating the term “large language models (LLM)”.Examples include 175B-parameter GPT-3 and 540B-parameter PaLM, contrasted with 330M-parameter BERT and 1.5B-parameter GPT-2.
  • Evolution of language models: Language models progressed from statistical next-token prediction and neural representation learning to pre-training and fine-tuning, then to LLMs that act as general-purpose task solvers.Statistical models addressed specific tasks, neural models learned task-agnostic representations, PLMs learned context-aware representations, and LLMs explored scaling effects on model capacity.
  • Distinctive characteristics of LLMs: LLMs differ from smaller PLMs through emergent abilities, prompting-based access, and development that combines large-scale engineering with research.Users must format tasks through prompting interfaces, while training requires extensive data processing and distributed parallel training expertise.
  • Impact and challenges: LLMs are reshaping NLP, information retrieval, computer vision, and real-world applications, while raising unresolved questions about emergence, training, and alignment with human values.They can generate toxic, fictitious, or harmful content, and their training is costly because of substantial computation requirements and undisclosed practical details.
  • Survey scope and contributions: The survey synthesizes LLM advances across pre-training, adaptation, utilization, and capability evaluation, and provides supporting development resources through a GitHub project.It focuses on techniques and methods for developing and using LLMs while offering a relatively comprehensive reference to important aspects of the field.

2 OVERVIEW

This overview defines large language models, characterizes their capabilities through scaling and emergent abilities, and summarizes key development techniques. It traces the GPT-series evolution from decoder-only language modeling and scaling through code training, human alignment, and multimodal expansion, while noting ongoing safety and reliability challenges.

  • 2.1 Background for LLMs: LLMs are Transformer language models typically containing hundreds of billions or more parameters, trained on massive text data and capable of understanding language and solving complex tasks.This survey mainly focuses on models larger than 10B because no formal minimum parameter scale exists and capacity also depends on data size and total compute.
  • 2.1 Background for LLMs: Scaling laws show that model size, dataset size, and training compute strongly affect language-model performance, while KM and Chinchilla prescribe different compute allocations between model and data size.KM favors allocating more additional compute to model size, whereas Chinchilla argues for increasing model and data sizes at similar scales.
  • 2.1 Background for LLMs: Scaling laws support predictable training decisions and monitoring, but task-level outcomes can be harder to predict because inverse scaling and unpredictable abilities may occur.Small proxy models can guide data-mixture schedules and reveal training anomalies, while data scarcity may require repetition or augmentation as model scale grows.
  • 2.1 Background for LLMs: Emergent abilities are capabilities absent from small models that arise beyond a scale threshold, including in-context learning, instruction following, and step-by-step reasoning.In-context learning appeared strongly in 175B GPT-3, instruction-tuned LaMDA-PT began outperforming its untuned version at 68B, and CoT gains appeared above 60B and became clearer above 100B.
  • 2.1 Background for LLMs: LLM development combines scaling, distributed and stable training, ability elicitation, alignment tuning, and external tools to expand capabilities and mitigate harmful or outdated outputs.Examples include DeepSpeed and Megatron-LM, chain-of-thought and instruction tuning, RLHF in InstructGPT, and calculators or search engines.
  • 2.2 Technical Evolution of GPT-series Models: GPT models compress world knowledge into decoder-only Transformers through next-word prediction and scaling, with GPT-1 establishing the architecture and GPT-2 extending it toward unsupervised multitask solving.GPT-1 combined unsupervised pre-training with supervised fine-tuning, while GPT-2 scaled to 1.5B parameters and used WebText to cast tasks as conditional word prediction.
  • 2.2 Technical Evolution of GPT-series Models: The overview frames GPT-1 and GPT-2 as foundations for GPT-3 and GPT-4, while Table 1 catalogs large models above 10B by capacity, data, hardware, availability, adaptation, and evaluation.GPT-2 remained inferior to supervised fine-tuning methods overall, motivating subsequent progression toward more powerful GPT-series models.
  • 2.2 Technical Evolution of GPT-series Models: GPT-3 scaled to 175B parameters, introduced in-context learning, and empirically showed that substantial neural-network scaling can greatly increase model capacity.It demonstrated strong performance across NLP, reasoning, and domain-adaptation tasks, with larger models showing stronger in-context learning abilities.
  • 2.2 Technical Evolution of GPT-series Models: Code training and human alignment produced stronger GPT-3.5 models, improving reasoning and instruction following while mitigating harmful or toxic outputs.Codex was fine-tuned on GitHub code and improved difficult programming and mathematics tasks; InstructGPT established three-stage RLHF for alignment.
  • 2.2 Technical Evolution of GPT-series Models: ChatGPT combined InstructGPT-like training with dialogue-specific human conversations, achieving strong knowledge, reasoning, multi-turn context tracking, and human-value alignment.Its later plugin mechanism extended capabilities through existing tools or apps, and its launch significantly influenced subsequent AI research.
  • 2.2 Technical Evolution of GPT-series Models: GPT-4 extended text input to multimodal signals and substantially improved complex-task performance, safety, and development practices over GPT-3.5.Its six-month iterative alignment added a safety reward signal, while red teaming and predictable scaling addressed deployment risks and performance estimation.
  • 2.2 Technical Evolution of GPT-series Models: GPT-4V and GPT-4 Turbo expanded GPT capabilities through vision, longer context, updated knowledge, lower-cost performance, function calling, reproducible outputs, and multimodal interaction.GPT-4 Turbo supported up to 128k tokens and enabled agent-like assistants through the Assistants API, while GPT-4V addressed risks from visually augmented inputs.
  • 2.2 Technical Evolution of GPT-series Models: Despite major advances, GPT models can still hallucinate factual errors or produce risky responses, motivating safer, more capable systems and iterative deployment practices.OpenAI’s five-stage development and deployment life cycle aimed to reduce potential risks in model and product use.

3 RESOURCES OF LLMS

This section surveys publicly available resources for developing and reproducing LLMs, covering model checkpoints and APIs, corpora, fine-tuning and alignment datasets, and libraries for training, inference, serving, optimization, and large-scale computation.

  • 3.1 Publicly Available Model Checkpoints or APIs: Publicly available LLM checkpoints and APIs offer reusable alternatives for research amid costly pre-training, with APIs supporting inference without local deployment and checkpoint descriptions guiding selection by resource budget and usage needs.LLaMA-3.1 has 405B parameters, 15T pre-training tokens, and a 128K context window; its 405B version involves more than 16,000 H100 GPUs.
  • 3.1 Publicly Available Model Checkpoints or APIs: LLaMA’s openness and effectiveness have driven extensive derivative work, including instruction-tuned, multilingual, and multimodal variants such as Alpaca, Vicuna, LLaVA, MiniGPT-4, InstructBLIP, and PandaGPT.Instruction tuning LLaMA is widely used for customized models because of relatively low computational costs, while Vicuna is particularly preferred as a base for multimodal language models.
  • 3.2 Commonly Used Corpora for Pre-training: LLM pre-training commonly combines accessible web, book, academic, Wikipedia, code, and mixed corpora rather than relying on a single dataset.CommonCrawl requires preprocessing because of noisy web information; examples of reusable resources include RedPajama-Data, RefinedWeb, Project Gutenberg, Wikipedia, The Stack, The Pile, ROOTS, and Dolma.
  • 3.3.1 Instruction Tuning Datasets: Instruction-tuning datasets are organized into NLP task, daily chat, and synthetic categories to enhance or unlock abilities such as instruction following.Examples include P3 and FLAN for formatted NLP tasks, ShareGPT, OpenAssistant, and Dolly for real-world conversations, and Self-Instruct-52K, Alpaca, and Baize for LLM-generated data.
  • 3.3.2 Alignment Datasets: Alignment datasets provide preference and feedback signals for helpfulness, honesty, and harmlessness through human comparisons, expert annotations, naturally occurring responses, and model-generated feedback.Representative resources include HH-RLHF, SHP, PKU-SafeRLHF, Stack Exchange Preferences, and Sandbox Alignment Data, with SHP containing 385K human preferences and Stack Exchange Preferences about 10M questions and answers.
  • 3.4 Library Resource: Transformers and DeepSpeed supply core software infrastructure for building, customizing, and efficiently training LLMs.Transformers offers a user-friendly API for pre-trained Transformer models, while DeepSpeed supports distributed-training optimizations including ZeRO, gradient checkpointing, and pipeline parallelism.
  • 3.4 Library Resource: Megatron-LM, JAX, Colossal-AI, BMTrain, and FastMoE provide complementary libraries for distributed, accelerated, memory-efficient, or mixture-of-experts training.Their capabilities include model/data parallelism, mixed precision, FlashAttention, automatic differentiation, just-in-time compilation, heterogeneous memory optimization, low-resource training, and Transformer-to-MoE conversion.
  • 3.4 Library Resource: Colossal-AI has also supported ColossalChat, releasing 7B and 13B ChatGPT-like models developed with Colossal-AI and LLaMA.Colossal-AI is implemented on PyTorch and supports parallel training strategies and heterogeneous memory management through PatrickStar.
  • 3.4 Library Resource: vLLM and DeepSpeed-MII target fast, memory-efficient LLM inference and serving through optimized attention or KV caching, batching, CUDA kernels, and broad model support.vLLM additionally supports decoding algorithms, tensor parallelism, streaming outputs, HuggingFace models, and OpenAI-compatible API servers, while DeepSpeed-MII supports over 13,000 models across architectures including LLaMA, Mistral, and OPT.
  • 3.4 Library Resource: DeepSpeed-Chat [210] integrates ChatGPT-like model training and inference with a complete InstructGPT -style pipeline covering SFT, reward-model fine-tuning, and RLHF.Its unified hybrid engine enables seamless switching between training and inference while applying DeepSpeed Inference optimizations.
  • 3.4 Library Resource: PyTorch, TensorFlow, MXNet, PaddlePaddle, MindSpore, and OneFlow support parallel algorithms commonly used to train large-scale models.

4 PRE-TRAINING

This section surveys the main components of LLM pre-training, including data preparation and scheduling, architecture and objectives, decoding strategies, and optimization and scalable-training techniques. It emphasizes how data quality, model design, and efficiency and stability mechanisms shape the development and training of language models.

  • 4 PRE-TRAINING: Pre-training on large-scale corpora establishes essential language understanding and generation abilities, with corpus scale and quality critical to LLM capability.Effective pre-training also requires suitable architectures, acceleration methods, and optimization techniques.
  • 4.1 Data Collection and Preparation: LLM pre-training data combines general sources such as webpages, books, and conversations with specialized multilingual, scientific, and code datasets to support broad or targeted capabilities.General data supports language modeling and generalization, whereas specialized data improves capabilities such as multilingual understanding, scientific reasoning, and program synthesis.
  • 4.1.1 Data Source: Data sources require targeted handling: web data needs quality filtering, conversations can improve conversational and question-answering performance but may impair instruction efficacy when excessive, and code supports accurate program synthesis.Multilingual corpora improve multilingual tasks, while scientific data supports scientific and reasoning tasks.
  • 4.1.2 Data Preprocessing: Cleaning pre-training data through quality filtering, toxic-data removal, and deduplication improves model performance and training stability, while duplicate data can cause double descent and weaken in-context copying.Preprocessing also addresses privacy through PII removal and uses tokenization methods such as BPE, WordPiece, and Unigram; corpus-specific tokenizers can help but may disadvantage non-English data.
  • 4.1.3 Data Scheduling: Data scheduling controls both source proportions and presentation order: diverse mixtures improve downstream performance, while curricula that progress from general or basic data to specialized data can strengthen targeted skills.Increasing domain-specific data can enhance mathematics, coding, long-term dependency, or other abilities, but excessive concentration in one domain can reduce generalization.
  • 4.1.4 Summary of Data Preparation: Preparing pre-training data therefore requires coordinated decisions about data sources, preprocessing, mixtures, and curricula to align corpus composition with the capabilities sought from the LLM.These procedures constitute the three main aspects summarized for pre-training data preparation.
  • 4.1.4 Summary of Data Preparation: Pre-training data should combine diverse high-quality sources, remove duplicates, toxic or private content, standardize formats, and use a tuned mixture and curriculum.Small-model experiments can select candidate data plans, while intermediate checkpoints can guide dynamic adjustment of data mixtures and distributions.
  • 4.2.1 Typical Architectures: Transformer is the dominant LLM backbone because of its parallelizability and capacity, with encoder-decoder, causal decoder, and prefix decoder as the main architectures.Causal decoders are widely adopted, while prefix decoders support bidirectional prefix encoding and autoregressive generation; state-space alternatives improve efficiency but still lag Transformers in performance.
  • 4.2.1 Typical Architectures: Mixture-of-experts sparsely activates weights per input, scaling parameter count at constant computational cost but introducing routing-related training instability.Increasing the number of experts or total parameters can improve performance; high-precision routing tensors and smaller-range initialization can improve stability.
  • 4.2.2 Detailed Configuration: Attention and configuration methods trade computational cost, memory use, and quality through sparse, multi-query or grouped-query, FlashAttention, and PagedAttention mechanisms.FlashAttention-2 achieves around 2× speedup over the original FlashAttention, while PagedAttention improves GPU utilization and memory sharing through paged KV-cache allocation.
  • 4.2.2 Detailed Configuration: Recommended Transformer configurations use pre-RMSNorm, SwiGLU or GeGLU, and RoPE or ALiBi for stronger generalization, training stability, and long-sequence performance.RMSNorm improves training speed and performance, while ALiBi improves extrapolation beyond training lengths and can improve BLOOM training stability.
  • 4.2.3 Pre-training Tasks: Language modeling autoregressively predicts subsequent tokens and can transfer decoder-only LLMs to tasks without fine-tuning, whereas prefix language modeling performs slightly worse with the same pre-training tokens.Denoising autoencoding reconstructs randomly replaced spans but is more complicated to implement and is less common in LLM pre-training, with T5 and GLM-130B as examples.
  • 4.2.3 Pre-training Tasks: Pre-training tasks can use S-denoiser, R-denoiser, or X-denoiser objectives, which differ in autoregressive versus span-denoising behavior and corruption length or ratio.MoD applies these denoisers according to special input tokens and was used in PaLM 2 [120].
  • 4.2.4 Decoding Strategy: Greedy search is effective when outputs depend strongly on inputs but can produce awkward, repetitive text in open-ended generation, motivating beam, sampling, and diversity-oriented alternatives.Beam search retains the n highest-probability partial sentences, whereas sampling increases randomness and diversity; length penalties, repetition penalties, diverse beam search, temperature, top-k, and top-p further adjust generation.
  • 4.2.5 Summary and Discussion: Causal decoder architectures show strong zero-shot and few-shot generalization and benefit substantially from scaling, but their theoretical advantage over alternatives remains unproven.Existing work reports better zero-shot performance without multi-task fine-tuning, while GPT-3 demonstrates few-shot learning; further analysis, especially of large encoder-decoder models, is needed.
  • 4.3.1 Optimization Setting: LLM optimization commonly combines large or dynamically increasing batches, warm-up and cosine-decay learning rates, Adam-family optimizers, and gradient clipping or weight decay for stability.GPT-3 increases its batch size from 32K to 3.2M tokens; learning rates warm up over 0.1% to 0.5% of steps, peak near 5 × 10−5 to 1 × 10−4, and decay to approximately 10% of the maximum, while gradient clipping and weight decay are commonly set to 1.0 and 0.1.
  • 4.3.1 Optimization Setting: Training instability can cause model collapse or loss spikes, so systems restart from earlier checkpoints, skip problematic data, or shrink abnormal embedding-layer gradients.PaLM and OPT use checkpoint restart and data skipping, while GLM targets embedding-gradient abnormalities.
  • 4.3.2 Scalable Training Techniques: Large-model training must address throughput and GPU-memory limits through 3D parallelism, mixed precision, memory-reduction methods, and early detection or prediction of training problems.3D parallelism combines data, pipeline, and tensor parallelism; BF16 generally improves representation accuracy over FP16, and BLOOM was trained on 384 A100 GPUs using 8-way data, 4-way tensor, and 12-way pipeline parallelism.

5 POST-TRAINING OF LLMS

This section examines post-training methods for adapting LLMs, covering instruction and alignment tuning, supervised fine-tuning, RLHF, and parameter-efficient approaches. It also discusses factors influencing tuning performance, feedback and reward-modeling processes, training strategies, and adaptation costs.

  • 5.1.1 Formatted Instance Construction: Instruction-formatted instances combine task descriptions, optional inputs, outputs, and demonstrations, constructed from NLP datasets, real user chats, or synthetic generation methods.Self-Instruct can expand an initial pool of 175 instances, while later methods target greater complexity, diversity, alignment, and output quality.
  • 5.1.1 Formatted Instance Construction: Instruction-data quality, diversity, formatting, and selection materially affect generalization, while scaling tasks helps until gains become negligible and small high-quality datasets can suffice.CoT examples can elicit reasoning, whereas unsuitable instruction components may have negligible or adverse effects.
  • 5.1.2 Instruction Tuning Strategies: Effective instruction tuning strategies balance datasets, mix task, chat, and synthetic data, optionally combine tuning with pre-training, and use staged schedules to prevent capacity forgetting.Response-only loss masking reduces redundant computation for multi-turn chat fine-tuning.
  • 5.1 Instruction Tuning: Instruction tuning fine-tunes pre-trained LLMs on formatted natural-language instances, improving abilities across model scales, architectures, objectives, and adaptation methods at lower cost than pre-training.It can enable smaller fine-tuned models to outperform larger untuned models.
  • 5.1.3 The Effect of Instruction Tuning: Instruction tuning enables following human instructions on seen and unseen tasks, alleviates repetitive or incomplete generation, transfers skills across languages, and supports domain specialization.BLOOMZ-P3 achieved more than 50% improvement over BLOOM on multilingual sentence completion, while Med-PaLM reached performance comparable to expert clinicians.
  • 5.1.4 Empirical Analysis for Instruction Tuning: The empirical analysis compares LLaMA 7B and 13B using FLAN-T5, ShareGPT, and Self-Instruct datasets, evaluating individual, combined, and synthetic-data improvement strategies.The tested strategies include increasing complexity or diversity, balancing difficulty, and scaling instruction number; larger FLAN-T5 data was sampled to 80,000 instructions for fair comparison.
  • 5.1.4 Empirical Analysis for Instruction Tuning: 43.69 vs. 38.58 in MMLU shows that mixing FLAN-T5, ShareGPT, and Self-Instruct-52K instructions improves LLaMA 7B’s comprehensive abilities, while complexity and diversity further improve performance.However, scaling instructions alone decreased BBH from 29.81 to 26.63, and moderate-difficulty filtering slightly reduced QA performance; LLaMA 13B improved MMLU from 38.11 to 47.49 over LLaMA 7B.
  • 5.2.1 Background and Criteria for Alignment: Alignment tuning addresses unintended, harmful, misleading, biased, or fabricated behavior by aligning LLMs with human expectations, while recognizing an alignment tax on general abilities.Representative criteria are helpfulness, honesty, and harmlessness, but their subjectivity makes them difficult to formulate directly as optimization objectives; red teaming probes harmful outputs adversarially.
  • 5.2.2 Collecting Human Feedback: Human feedback quality depends on qualified labelers, researcher-labeler agreement, detailed annotation guidance, and feedback formats including ranking, question-based, and rule-based approaches.InstructGPT screens labelers by agreement, while Sparrow combines pairwise preferences with rule-violation assessments; GPT-4 also uses zero-shot classifiers as rule-based reward models.
  • 5.2.3 Reinforcement Learning from Human Feedback: RLHF fine-tunes LLMs toward human preferences through a pretrained language model, a reward model, and an RL algorithm such as PPO [128].The standard process optionally performs supervised fine-tuning, trains the reward model on human-ranked outputs, and applies RL with reward and KL-divergence control; RLAIF can replace human preference annotation with AI feedback.
  • 5.2.3 Reinforcement Learning from Human Feedback: Large reward models often judge generated outputs more effectively, but LM-loss regularization can reduce their overfitting, while multiple reward models support distinct alignment criteria.Effective RL training uses rejection sampling or best-of-N supervision before RL, iterative reward-model improvement, and prior-iteration samples to mitigate capacity regression.
  • 5.2.3 Reinforcement Learning from Human Feedback: Efficient RLHF can separate reward-model serving from LLM serving and use beam search for candidate generation, reducing memory and computation costs during iterative inference.Process-supervised RLHF evaluates individual sentences, words, or reasoning steps rather than only the whole generated text, providing finer-grained guidance but requiring harder-to-obtain supervision.
  • 5.2.4 Alignment without RLHF: Non-RL alignment fine-tunes LLMs on curated alignment data, requiring methods for constructing feedback-rich datasets and designing supervised, ranking, contrastive, or preference-based losses.DPO removes explicit reward modeling by reparameterizing rewards through the policy model, but its balance between positive and negative examples and dependence on the reference model remain limitations.
  • 5.2.4 Alignment without RLHF: Alignment data can come from reward-model selection, powerful LLMs applying human-written principles, or interactive multi-agent environments that critique and revise responses.Constitutional AI and Self-Align generate aligned responses from principles, while Stable Alignment uses simulated agents to provide ratings and revision suggestions.
  • 5.2.5 Remarks on SFT and RLHF: SFT directly imitates demonstration outputs with token-level teacher forcing, whereas RLHF optimizes text-level rewards from human preferences and can explore beyond demonstrated behavior.SFT is effective for increasing capacity and task generalization but mainly unlocks existing abilities; high-quality instruction data matters more than quantity, and weak or out-of-scope demonstrations can worsen hallucination.
  • 5.2.3 Reinforcement Learning from Human Feedback: RLHF aligns LLM behavior with human preferences through reward modeling and reinforcement learning, but requires multiple models and complex, hyperparameter-sensitive optimization.RLHF can improve helpfulness and harmlessness and reduce hallucinations, yet it suffers from sample inefficiency, instability, and dependence on strong SFT initialization.
  • 5.3.2 Parameter-Efficient Fine-Tuning on LLMs: Despite extensive parameter-efficient tuning research, most methods were tested on smaller pretrained models, leaving their effects across large models, settings, and tasks insufficiently investigated.The survey identifies this lack of thorough large-model evaluation as an open limitation.
  • 5.3.1 Parameter-Efficient Fine-Tuning Methods: Parameter-efficient adaptation freezes the base model and trains small task-specific components, including adapters, layerwise prefixes, input prompts, or low-rank updates.LoRA represents each update as ∆W = A · B^T with k ≪ min(m, n), reducing memory and storage while allowing one base model to support multiple task-specific adaptations.
  • 5.3.2 Parameter-Efficient Fine-Tuning on LLMs: LoRA and related efficient-tuning methods have been applied to open-source LLMs, with PEFT providing implementations for methods including LoRA, AdaLoRA, prefix tuning, P-Tuning, and prompt tuning.Examples include Alpaca-LoRA and LLaMA-Adapter, which extend lightweight tuning to instruction following and multimodal settings.
  • 5.3.2 Parameter-Efficient Fine-Tuning on LLMs: Efficient-tuning methods underperform GPT-3.5 on difficult math tasks but match it on simple tasks, with LoRA performing relatively well using fewer trainable parameters.The comparison covered serial and parallel adapters and LoRA on GPT-J, BLOOM, and LLaMA across six math-reasoning datasets.

6 UTILIZATION

This section surveys LLM utilization through prompting, in-context learning, chain-of-thought reasoning, and prompt-based planning. It covers prompt and demonstration design, reasoning and planning mechanisms, and iterative refinement using execution feedback and memory.

  • 6 UTILIZATION: Prompting is the major approach to utilizing LLMs, and prompt quality substantially influences performance across tasks.The utilization framework also includes chain-of-thought prompting for intermediate reasoning and planning, which decomposes complex tasks into sub-tasks and solves them sequentially.
  • 6.1.1 Prompt Creation: Prompt engineering uses task description, input data, contextual information, and prompt style, with clear directives, task decomposition, demonstrations, model-friendly formats, and role-playing helping elicit LLM abilities.Structured inputs can be linearized or represented as executable code, while retrieved evidence and multi-turn decomposition support specialized tasks.
  • 6.1.1 Prompt Creation: Carefully designed prompts improve ChatGPT performance over simpler prompts, especially on complex tasks, with WikiFact increasing from 23.61 to 28.47 and Colored Objects from 53.20 to 66.75.For GSM8k, code-formatted demonstrations and an external program executor increase performance from 78.47 to 79.30; proper prompts can sometimes approach or exceed supervised baselines, but performance remains task-dependent.
  • 6.1.2 Prompt Optimization: Manual prompting is intuitive but time-consuming and prompt-sensitive, motivating automatic optimization of discrete prompts through gradient-based, reinforcement-learning, edit-based, and LLM-based methods.Discrete optimization faces a combinatorial search space; continuous prompts can be trained efficiently with downstream data, while transfer methods address data-scarce target tasks.
  • 6.2.1 ICL Formulation: In-context learning formats a task description and demonstrations as natural-language prompts, enabling LLMs to perform new tasks without explicit gradient updates.Its construction appends a test query after selected, formatted, and ordered demonstrations, leaving the answer to be predicted by the LLM.
  • 6.2.2 Demonstration Design: ICL effectiveness depends strongly on demonstration design, requiring decisions about example selection, formatting, and ordering.Demonstration selection can use heuristic relevance, diversity, or both, while LLM-based approaches are also identified as a major selection category.
  • 6.2.3 Underlying Mechanism: Task recognition is accessible to models as small as 350M parameters, whereas task learning emerges at least at 66B parameters and can acquire knowledge beyond prior knowledge.Meta-In-Context Learning and Symbol Tuning improve task learning by supplying multiple related tasks or semantically unrelated labels.
  • 6.3.1 Basic CoT Prompting Approach: CoT prompting extends ICL by adding intermediate reasoning steps, which LLMs can generate from simple instructions such as “Let’s think step by step.”Basic CoT follows a chain structure, while code-based or dynamically selected CoTs can provide more structured reasoning for complex tasks.
  • 6.3.2 Improved CoT Prompting Strategies: Improved CoT methods address incorrect and unstable reasoning through diverse prompts, sampled or verified reasoning paths, and tree- or graph-structured thought exploration.Graph reasoning offers greater flexibility and can reuse thoughts across paths, but its many LLM interactions make exploration inefficient; XoT guides search with policy and value networks.
  • 6.3.3 Further Discussion on CoT Prompting: CoT prompting mainly benefits sufficiently large models on step-by-step reasoning tasks, can hurt performance on non-reasoning tasks, and helps most when standard prompting performs poorly.CoT reasoning is typically effective for models with 10B or more parameters and tasks such as arithmetic, commonsense, and symbolic reasoning.
  • 6.3.3 Further Discussion on CoT Prompting: CoT performance depends mainly on patterns and text rather than symbol correctness, with text helping generate patterns and patterns helping models understand tasks and generate useful text.The source of CoT reasoning is often hypothesized to involve code training, but publicly reported ablations are lacking, and non-CoT instruction tuning does not improve held-out CoT benchmarks.
  • 6.4.1 The Overall Framework: Prompt-based planning decomposes complex tasks into subtasks through a task planner, plan executor, and environment that exchanges execution feedback with the planner.The planner may generate natural-language action sequences or executable programs, while the executor and environment support iterative plan refinement.
  • 6.4.2 Plan Generation: Code-based planning generates executable Python or PDDL plans for deterministic solvers, improving verifiability over text plans whose faithful execution is not guaranteed.Text-based approaches use zero-shot instructions, demonstrations, tools, or model selection, while code-based approaches also support embodied agents.
  • 6.4.3 Feedback Acquisition: Planning feedback can come internally from LLM evaluations and memories or externally from tools, multimodal models, virtual worlds, and other communicating agents.Internal feedback can score candidate plans or convert sparse outcomes into textual guidance, while external feedback includes code errors, visual perception, and simulated-world interaction.
  • 6.4.4 Plan Refinement: Reasoning approaches extract critical information from irrelevant or non-language feedback, while ChatCoT enables flexible switching between reasoning and planning.ReAct uses demonstrations to generate reasoning traces and has been applied in AutoGPT, whereas ChatCoT unifies tool-augmented reasoning in multi-turn interaction.
  • 6.4.4 Plan Refinement: Backtracking methods address locally optimal plans by exploring alternative actions or revising entire plans using search and feedback signals.Tree of Thoughts uses breadth-first or depth-first search; DEPS selects plans from feedback, and TIP revises each initial-plan step.
  • 6.4.4 Plan Refinement: Long-term memory supports plan refinement for long-horizon tasks by storing feedback, successful plans, and reusable skills for retrieval and synthesis.Reflexion, Generative Agents, skill libraries [438] [530], vector databases such as milvus, and MemoryBank implement storage, retrieval, reuse, and memory updating or forgetting.

7 CAPACITY AND EVALUATION

This section evaluates LLM capacity across language generation, knowledge utilization, complex reasoning, and advanced abilities using benchmarks, evaluation methodologies, and zero- or few-shot testing. It also highlights strong but uneven performance and persistent challenges in reasoning, reliability, specialization, interaction, tool use, hallucination, knowledge recency, and evaluation.

  • 7.1 Basic Ability: LLMs are evaluated across three basic abilities: language generation, knowledge utilization, and complex reasoning, using task-specific datasets and metrics.The survey focuses on widely studied tasks rather than complete coverage.
  • 7.1.1 Language Generation: LLMs achieve strong generation performance, but automatic metrics may not faithfully assess their quality, while LLM-based evaluation can differ from human judgments and exhibit bias.LLMs can evaluate single outputs, compare candidates, and improve existing metrics, but evaluator bias remains a concern.
  • 7.1.1 Language Generation: LLMs may underperform specialized or structured generation tasks because injecting domain knowledge can cause catastrophic forgetting or alignment tax, while retaining general abilities is difficult [650].They also require code data, candidate sampling, or planning-guided decoding for code synthesis, which is evaluated with pass@k and functional benchmarks.
  • 7.1.2 Knowledge Utilization: Retrieved evidence can improve open-book QA enough for a smaller LLM to outperform models 10× larger, whereas knowledge completion remains weak for rare relations.InstructGPT outperforms GPT-3 across all WikiFact subsets under the same evaluation settings.
  • 7.1.2 Knowledge Utilization: LLMs hallucinate information that conflicts with or cannot be verified by sources, and their parametric knowledge is difficult to update promptly; alignment, tools, retrieval, and editing offer partial remedies.Hallucinations can persist in powerful models such as GPT-4 and may mislead real-world applications, while direct knowledge editing remains an open problem.
  • 7.1.3 Complex Reasoning: Chain-of-thought prompting, code reformulation, scratchpads, tutors, mathematical pretraining, and interactive theorem provers improve complex reasoning, but LLMs still lag humans and may produce inconsistent reasoning paths.Process feedback, self-reflection, external verification, and ensembles are proposed to align reasoning processes with final answers.
  • 7.1.3 Complex Reasoning: LLMs struggle with numerical computation for rarely seen symbols, while synthesized arithmetic training, scratchpad tracing, external tools, and digit-level tokenization can improve performance.Subword tokenization may split numbers inconsistently, whereas digit-based tokenization avoids mismatched numerical substrings.
  • 7.2 Advanced Ability: Advanced evaluation covers human alignment, interaction with external environments, and tool manipulation as practical abilities beyond standard task performance.These abilities concern conforming to human values, acting properly in real-world scenarios, and expanding the scope of model capabilities.
  • 7.2.1 Human Alignment: Human alignment is assessed through helpfulness, honesty, and safety using adversarial datasets, harmlessness benchmarks, expert or human evaluation, and alignment-focused annotation.Alignment tuning with expert-interaction data can reduce GPT-4’s incorrect behavior on sensitive or disallowed prompts, while high-quality pre-training data may reduce alignment effort.
  • 7.2.2 Interaction with External Environment: LLMs can generate realistic action plans and interact with simulated or open-world environments, evaluated through executability, correctness, task success, and human assessment.Benchmarks include VirtualHome, ALFRED, BEHAVIOR, Minecraft, and Internet environments; proposed improvements include code-like prompts and real-world grounding.
  • 7.2.3 Tool Manipulation: Tool manipulation is evaluated on reasoning and knowledge tasks, with tools improving calculation and timely question answering, while tool retrieval and token encoding address context limits.LLMs can also autonomously create and explore tools, extending their potential for solving diverse real-world tasks.
  • 7.3.1 Comprehensive Evaluation Benchmarks: Comprehensive benchmarks show strong scaling-related performance: GPT-4 reaches 86.4% on MMLU in the 5shot setting, scaled LLMs exceed average human performance on 65% of BIG-bench tasks, and instruction tuning improves HELM accuracy, robustness, and fairness.Human-exam benchmarks report GPT-4 surpassing average human performance on AGIEval while remaining below top human performance; API models generally outperform publicly available models.
  • 7.3.2 Evaluation Approaches: Evaluation is organized by base, fine-tuned, and specialized LLMs and uses benchmark-based, human-based, or model-based approaches, each with distinct coverage and limitations.Benchmark results depend on prompts, shot settings, parsing, and contamination; human evaluation is direct but costly and subjective, while model judges are scalable but can exhibit position, verbosity, self-enhancement, and reasoning biases.
  • 7.4.1 Experimental Settings: The empirical evaluation selects representative open-source base and instruction-tuned models alongside closed-source API models, including LLaMA, Vicuna, ChatGPT, Claude, and Claude 2.The setup includes models from 6B to 13B parameters, while experiments with larger models remain scheduled because of computational-resource limits.
  • 7.4.1 Experimental Settings: The evaluation covers language generation, knowledge utilization, complex reasoning, and human alignment, mainly using zero-shot tests and 3-shot prompting for harder symbolic and mathematical reasoning tasks.It uses task-specific metrics, including accuracy, BLEU-4, ROUGE-L, pass@10, exact match, solve rate, and toxicity score, and chain-of-thought prompting for mathematical reasoning.
  • 7.4.2 Results Analysis and Findings: ChatGPT wins most evaluated tasks among closed-source models, including 78.47 versus 49.96 on GSM8k and 79.88 versus 51.22 on HumanEval.These models otherwise perform well across many general-purpose tasks, including complex tasks.
  • 7.4.2 Results Analysis and Findings: Claude 2, ChatGPT, and Davinci003 outperform other closed-source models on environment interaction and tool manipulation, including 36.40 versus 26.00 on HotpotQA and 44.53 versus 7.74 on Gorilla-TF.The passage attributes this advantage possibly to optimization for advanced abilities and external-plugin use.
  • 7.4.2 Results Analysis and Findings: All comparison models perform poorly on MATH and HotpotQA, while machine translation is relatively weak, possibly because minor-language examples are underrepresented in pre-training data.MATH requires complex mathematical understanding, and HotpotQA requires multi-hop reasoning across documents.
  • 7.4.2 Results Analysis and Findings: Instruction-tuned open-source models generally outperform base models, but Vicuna (7B) and Alpaca (7B) degrade on LAMBADA after tuning.Instruction data may improve few-shot and zero-shot task solving while being less useful for general language modeling.
  • 7.4.2 Results Analysis and Findings: Larger open-source models mostly outperform smaller ones, with scaling especially beneficial on symbolic and mathematical reasoning tasks.The reported comparisons involve Vicuna 7B versus 13B and Pythia 7B versus 13B; open-source findings remain limited to these model sizes.

8 APPLICATIONS

This section surveys applications of LLMs across classic NLP, information retrieval, recommender systems, multimodal settings, knowledge-graph enhancement, automated evaluation, and professional domains. It also examines challenges including efficiency, adaptation, data, evaluation, hallucination, bias, safety, privacy, and domain-specific reliability.

  • 8.1 LLM for Research Community: LLM applications reshape AI research by extending language-model capabilities from foundational NLP tasks to retrieval, recommendation, and multimodal systems.The section presents selected examples rather than comprehensive coverage of all research directions or domains.
  • 8.1.1 LLM for Classic NLP Tasks: LLMs provide unified, competitive zero/few-shot solutions for classic NLP tasks, while fully supervised small models often remain stronger when high-quality labeled data and task-specific tuning are available.LLMs perform well on word- and sentence-level tasks through in-context learning, but can struggle with sequence tagging, complex information extraction, and low-resource generation; combining LLMs with small models is promising [765] [766].
  • 8 APPLICATIONS: The applications reviewed illustrate LLMs as flexible general-purpose components whose practical value depends on task data, domain adaptation, computational efficiency, and human or model collaboration.These considerations recur across the surveyed research directions and motivate future work on efficient deployment, richer adaptation, and robust multimodal evaluation.
  • 8.1.2 LLM for Information Retrieval: In information retrieval, LLMs act mainly as zero/few-shot rerankers or fine-tuned retrieval models, while also improving small systems through relevance annotation, query rewriting, document expansion, and generated training data [777] [778] [791] [793] [794] [796] [797].High inference overhead, long-text limitations, and the need for ranking adaptation motivate more efficient architectures and multimodal retrieval systems [781, 785, 798–800].
  • 8.1.3 LLM for Recommender Systems: LLMs support recommendation through zero-shot prompting, instruction tuning, semantic identifiers, enhanced user-item representations, knowledge distillation, and agent-based simulation of user and item interactions.However, zero/few-shot LLM recommenders often underperform traditional ID-based systems, while tuning cost, latency, memory, and long interaction histories remain deployment barriers.
  • 8.1.4 Multimodal Large Language Model: Multimodal large language models combine image encoders, connection modules, and LLMs through vision-language alignment pretraining followed by visual instruction tuning.Instruction quality and training strategy must balance multimodal adaptation against preservation of language capabilities, while MLLM evaluation spans perception, cognition, open-ended assessment, hallucination, and dedicated benchmarks [834, 854, 847].
  • 8.1.4 Multimodal Large Language Model: Multimodal LLMs remain vulnerable to factual inaccuracies, hallucinations, baseless image inferences, and harmful content, while existing mitigation methods mainly target isolated alignment aspects rather than comprehensive criteria.Proposed remedies include specialized visual instructions, post-hoc revision models, and RLHF, but broader safety and alignment efforts are still needed.
  • 8.1.5 KG-Enhanced LLM: Knowledge-graph-enhanced LLMs retrieve relevant subgraphs for prompting or iteratively interact with graph interfaces to solve complex multi-hop tasks, while structured-data access and knowledge updates remain open challenges.Retrieval approaches address knowledge selection and use through small retrievers, iterative reading-reasoning, serialization, or text transformation; synergy-augmented approaches decompose tasks into subgoals and iteratively collect evidence, with specialized interfaces reducing search space.
  • 8.1.6 LLM for Evaluation: LLM-based evaluators support score-based comparisons, language critiques, multi-agent collaboration, and specialized fine-tuning, but advanced models still fall short of human-level evaluation in challenging settings.MT-Bench reports that GPT-4 closely agrees with human preferences on 80 multi-turn questions without ties, whereas LLMBar finds even the most advanced LLMs remain below human-level evaluation; evaluator biases also persist.
  • 8.2 LLM for Specific Domains: LLMs are applied in healthcare, education, finance, and scientific research, supporting medical tasks, classroom teaching, financial analysis, and multiple stages of the scientific research pipeline.Med-PaLM achieves expert-level performance on the USMLE, while BloombergGPT demonstrates remarkable performance across diverse financial tasks.

9 ADVANCED TOPICS · 9.1 Long Context Modeling · 9.2 LLM-empowered Agent

Section 9 surveys advanced techniques addressing LLM limitations in long-context modeling and agent systems. It covers position and context-window adaptation, long-text data, agent architectures and applications, and challenges in efficiency, alignment, capability extension, robustness, and trustworthiness.

  • 9.1 Long Context Modeling: LLMs extend long-context capacity through position-embedding scaling, context-window adaptation, and continued pre-training on curated long-text data.These approaches address limited training lengths and context windows, with data quantity and quality materially affecting adaptation.
  • 9.1.1 Scaling Position Embeddings: Position interpolation extends context windows effectively and efficiently, while position truncation preserves local attention but requires twice-computed attention matrices.Position interpolation can harm performance on normal texts within the original window, whereas direct fine-tuning is inherently slow.
  • 9.1.1 Scaling Position Embeddings: Decreasing RoPE’s base improves extrapolation beyond training length, whereas increasing the base performs better within the training length.Base modification changes rotation wavelengths; continual pre-training may be needed to adapt models to longer context windows.
  • 9.1.2 Adapting Context Window: Context-window adaptation uses parallel segmentation, Λ-shaped attention, and token or block selection, trading sequence-order or long-range dependency modeling for reduced memory or computation.Parallel windows cannot distinguish segment order; Λ-shaped attention supports extra-long generation with fixed memory but discards distant information; selection retrieves relevant tokens or blocks.
  • 9.1.3 Long Text Data: Several billion training tokens can enable LLaMA-2-7B or LLaMA-2-13B to exceed 100K-token context windows with effective context utilization, although short-text ability may decline.Coherent and cohesive long-text data improve modeling, up-sampling cohesive data helps further, and mixtures should avoid large distribution drift from original pre-training data.
  • 9.2 LLM-empowered Agent · 9.2.1 Overall Framework.: LLM-based agents use an LLM as the core computation unit with memory, planning, and execution integrated into an environment-feedback workflow.Memory combines short-term context with long-term external storage; planning proposes and refines text or code plans; execution uses the LLM or external tools across repeated interactions.
  • 9.2.2 Applications: Agent applications include single-agent task solvers and cooperative or competitive multi-agent systems using communication protocols such as dialogue, structured documents, embeddings, and debate.Examples include AutoGPT for tool-assisted iterative solving, and LangChain, AgentVerse, and AutoGen for multi-agent collaboration.
  • 9.2.3 Discussion: LLM-based agents remain constrained by computational burden, weak alignment with human sociality, limited tool compatibility, and robustness and trustworthiness concerns.Key issues include increasingly complex multi-agent communication, inadequate role-playing and self-awareness, limited tools in dynamic environments, adversarial inputs, and hallucinations despite mitigation techniques.

9.3 Analysis and Optimization for Model Training

This section analyzes the memory and computational challenges of scaling LLM training, then presents techniques for reducing memory use and maintaining efficiency. It estimates major memory costs and surveys checkpointing, sharding, offloading, FlashAttention, and sequence parallelism.

  • 9.3 Analysis and Optimization for Model Training: Scaling LLM training requires jointly optimizing GPU memory usage across clusters and computational throughput as model size grows.The section frames these as the two primary technical challenges motivating its quantitative memory analysis and advanced training techniques.
  • 9.3.1 Estimation of Training Memory Consumption: Training LLaMA-7B requires around 100GB for model states alone, while activations require 16GB per device under B = 1 and T = 2,048.Model states total 16P bytes, comprising parameters, gradients, and optimizer states; additional costs include framework, distributed-training, intermediate-result, and fragmentation overheads.
  • 9.3.2 Memory Optimization Methods: Memory optimization reduces training requirements through activation recomputation, partitioned model states, and CPU or disk offloading.Gradient checkpointing trades computation for memory; ZeRO partitions optimizer states, gradients, or parameters, with ZeRO-3 adding about 50% communication overhead while saving memory proportional to GPU count.
  • 9.3.3 Efficiency Optimization Methods: FlashAttention reduces attention memory transfers through tiling and operator fusion, enabling LLaMA2 (7B) at sequence length 2,048 and batch size 8 to require only one-tenth of standard computation time.It also reduces peak and activation memory by retaining intermediate results in cache until the final attention result is obtained.
  • 9.3.3 Efficiency Optimization Methods: Sequence parallelism partitions long sequences across devices, with DeepSpeed-Ulysses splitting hidden dimensions and Ring Attention splitting sequence length while supporting FlashAttention.Both methods target reduced communication during distributed attention computation, and Ring Attention acts as a distributed extension of FlashAttention.

9.4 Analysis and Optimization for Model Inference

This section analyzes LLM inference through prefill and decoding stages, finding that decoding is primarily memory-bound, and surveys system- and algorithm-level methods for improving efficiency.

  • 9.4.1 Analysis of Inference Efficiency: Inference efficiency is analyzed by comparing GPU compute capability and memory bandwidth with each model operation’s arithmetic intensity to identify memory- or compute-bound bottlenecks.The GPU’s maximum arithmetic intensity is Imax, while an operation is memory-bound when I < Imax and compute-bound when I > Imax.
  • 9.4.1 Analysis of Inference Efficiency: Decoding is memory-bound and the main source of LLM inference inefficiency, whereas prefill is compute-bound under the illustrated LLaMA (7B) and A100 setting.For prefill, major operations have arithmetic intensity near or above Imax = 142.51; for decoding, linear transformations and attention are below 8 versus 142.51.
  • 9.4.2 System-level Optimization: System-level methods reduce data transfer or increase arithmetic intensity through Flash-Decoding, PagedAttention, continuous batching, and Dynamic SplitFuse.Flash-Decoding parallelizes computation across KV-cache chunks; PagedAttention pages KV-cache memory and fuses attention operations; batching methods increase concurrent work and throughput.
  • 9.4.3 Algorithm-level Optimization: Algorithm-level optimizations accelerate autoregressive inference through speculative decoding, cascaded models, non- or semi-autoregressive generation, and early exiting.Speculative decoding achieves a notable 2× to 3× speedup without compromising generation quality, while non- or semi-autoregressive methods generally trade quality for speed and early-exit methods skip unnecessary computation.

9.5 Model Compression

Model compression reduces the substantial inference memory footprint of LLMs, primarily through quantization and, more briefly, pruning and distillation. LLM quantization favors post-training methods because retraining is costly, but large activation outliers make quantization difficult.

  • 9.5 Model Compression: LLM model compression targets the substantial memory footprint that makes inference costly in real-world deployment, emphasizing quantization alongside pruning and distillation.
  • 9.5.1 Quantization Methods: Quantization uses either quantization-aware training, which requires full model retraining, or post-training quantization, which requires no retraining.
  • 9.5.1 Quantization Methods: Because LLMs have many parameters, post-training quantization is preferred for its lower computational cost, although large outlier activations complicate quantization, especially for hidden activations.

Background for Quantization.

LLM quantization maps floating-point weights and activations to lower-precision integers, with calibration and specialized strategies needed to control quantization error. The survey finds that weight quantization is generally more tractable than activation quantization, while fine-tuning and other compression methods extend deployment efficiency.

  • Background for Quantization.: Quantization maps floating-point weights or activations to integers using scaling, zero-point, and rounding, then reconstructs values through dequantization; calibration may be static or dynamic.The range parameters α and β determine clipping and strongly affect quantization performance.
  • Background for Quantization.: Post-training quantization reduces error through outlier separation, salient-weight protection, fine-grained parameters, difficulty migration, and layerwise reconstruction optimization.LLM.int8() separates activation outliers; GPTQ enables 3- or 4-bit quantization for models such as 175B OPT, while AWQ uses activation-aware scaling and calibration search.
  • Background for Quantization.: QLoRA adds 16-bit adapters to quantized models, allowing 4-bit quantized models to achieve full 16-bit fine-tuning performance.Efficient fine-tuning also compensates for low-bit degradation and supports lightweight task-specific instruction or chat tuning.
  • Background for Quantization.: QAT with data-free distillation shows promising 4-bit results for weights and key-value cache, but not for 4-bit activation quantization.The study applies distillation to weights, activations, and key-value cache using LLaMA-based experiments.
  • Background for Quantization.: INT8 weight quantization usually reduces LLM memory without performance degradation, while INT4 or INT3 requires specialized methods and can preserve emergent abilities.A 4-bit 60B LLM is reported to outperform an 8-bit 30B LLM at the same memory cost, and in-context learning, step-by-step reasoning, and instruction following are seldom affected by 4-bit weight quantization.
  • Background for Quantization.: Activations are harder to quantize than weights because large outliers emerge in models with 6.7B parameters or more, making high-quality INT8 activation quantization difficult.Mixed-precision decomposition, fine-grained quantization, and difficulty migration reduce outlier effects, but lower-precision activation quantization remains unresolved even with QAT.
  • 9.5.2 Other Model Compression Methods: Distillation transfers capabilities from teacher to student models through white-box or black-box methods, while pruning removes parameters structurally or unstructurally.MINILLM distills 13B LLaMA to 7B; SparseGPT reaches 60% sparsity on OPT-175B, LLM-pruner retains 93.6% performance after removing 20% of LLaMA 7B parameters, and Sheared LLaMA retains 87.8% after pruning LLaMA2 7B to 2.7B parameters.
  • 9.5.3 Open-source Libraries: Open-source libraries support quantization and pruning, including Bitsandbytes, GPTQ-for-LLaMA, AutoGPTQ, llama.cpp, Torch-Pruning, and LLM-Pruner.Their capabilities include 4- and 8-bit inference, GPTQ-based LLaMA quantization, LoRA integration, quantized LLaMA execution on MacBook devices, and gradient-based structural pruning.

9.6 Retrieval-Augmented Generation

Retrieval-augmented generation (RAG) supplements LLMs with timely or domain-specific external information to reduce factual errors. Its workflow combines context retrieval, prompt construction, and response generation, with improvements targeting retrieval, context refinement, iterative use, and specialized training.

  • Overview: RAG retrieves relevant information from external sources and integrates it into the prompt to improve responses when internal knowledge is insufficient.External sources include the internet and domain-specific knowledge bases, providing timely or domain-relevant context.
  • Basic Workflow: The standard RAG workflow comprises context retrieval, prompt construction, and response generation.Retrieval finds relevant context, prompt construction incorporates it with the task, and generation uses the resulting prompt to answer.
  • Retrieval method improvement: Retrieval uses lexical sparse-vector indexing or semantic dense-vector search, while proposition-level units, query expansion, and query rewriting improve relevance-latency tradeoffs.LLMs can decompose complex queries into sub-queries, rewrite queries directly, or transfer query optimization to smaller models through knowledge distillation.
  • Retrieval Results Refinement: Prompt construction and response generation mitigate long, irrelevant, or contradictory retrieved content through reranking, extraction, compression, self-checking, and confidence-based retrieval decisions.These methods address biased attention and can trigger retrieval again when generated outputs are unreliable.
  • Retrieval results refinement: RAG refines retrieved results by reranking or filtering documents, jointly optimizing reranking and generation, and selecting query-relevant text or tokens.LLMs can perform reranking through prompts or examples, while summarization and token-level compression reduce irrelevant context.
  • RAG-enhanced training: RAG-enhanced instruction tuning and pre-training improve retrieved-content utilization by addressing positional bias, irrelevant context, and retrieval-generation capabilities.Training data may vary relevant-document positions, add distracting information, or use document portions as queries to reconstruct remaining content.

9.7 Hallucination

Section 9.7 characterizes hallucination as LLM-generated content inconsistent with factual information, covering its definitions, sources, detection methods, and mitigation strategies. It emphasizes that hallucinations arise from data, training, prompting, and decoding factors and can be addressed through model-, uncertainty-, and tool-based detection, alignment, retrieval, and improved decoding.

  • 9.7.1 Definition of Hallucination: Hallucinations include entity, relation-error, incompleteness, outdatedness, overclaim, and unverifiability errors in generated content.These categories cover incorrect entities or relationships, incomplete aggregated facts, obsolete information, claims beyond factual knowledge, and unverifiable information.
  • 9.7.2 Source of Hallucination: Training data, training procedures, prompts, and decoding strategies can each induce hallucinations in LLMs.Erroneous or biased data, outdated or domain-sparse distributions, long-range modeling limits, exposure bias, hallucinated instruction data, sycophancy, unclear prompts, and higher-temperature sampling are identified as contributing factors.
  • 9.7.3 Hallucination Detection: Hallucination detection uses model-based, uncertainty-based, and tool-based approaches.These methods prompt LLMs to identify hallucinations, estimate uncertainty from token probabilities or response consistency, or verify factual statements with external tools.
  • 9.7.3 Hallucination Detection: Tool-assisted verification can enable smaller models to approach stronger-model detection performance.HaluAgent uses search engines and calculators with 7B-size models to achieve comparable performance as GPT-4 in hallucination detection.
  • 9.7.4 Hallucination Mitigation: Hallucination mitigation combines human alignment, retrieval-augmented generation, and improved decoding strategies.Alignment methods refine preference feedback, retrieval systems supply and verify external knowledge during or after generation, and decoding methods exploit internal representations, attention heads, contextual contrasts, or knowledge-faithfulness scores.
  • 9.7.4 Hallucination Mitigation: Human preference optimization can reduce hallucinations but may also encourage sycophancy when models prioritize user demands over truthfulness.Proposed safeguards include aggregating multiple preferences and training on claims whose truthfulness is independent of user opinion.

9.8 Complex Reasoning

Long CoT reasoning gives LLMs more time to search for solutions in natural language before responding, using extended thought processes for complex tasks. The section covers its reasoning patterns, data construction, training methods, and broader test-time scaling tradeoffs.

  • 9.8.1 Overview and Analysis: Long CoT models search through natural-language reasoning with planning, evaluation, reflection, exploration, backtracking, and task-dependent reasoning patterns [1065].Identified patterns include systematic analysis, method reuse, divide-and-conquer, self-refinement, context identification, and constraint emphasis.
  • 9.8.2 Construction of Long CoT Data: High-quality long CoT data is constructed through teacher-model distillation, search-based synthesis such as MCTS, and multi-agent collaboration.MCTS generates and scores multi-step reasoning trajectories, while collaborating agents use reflection, debate, critiques, and counterarguments to refine solutions.
  • 9.8.3 Training Methods: Supervised long CoT tuning teaches two-part thought-and-solution outputs and can activate complex reasoning with limited data, including 3.9K distilled examples for Qwen2.5 (32B).STILL-2 [1067] achieved performance comparable to o1preview and QwQ in mathematical problem-solving; the capability also improves physics and chemistry when trained only on mathematics [1067].
  • 9.8.3 Training Methods: Long CoT instruction tuning may overproduce extended reasoning on simple problems, while its gains can plateau when additional supervised data or self-generated samples add little value.Rejection sampling and directional preference optimization help especially with limited warmup data, but their impact diminishes when demonstration data is sufficient [1067].
  • 9.8.4 Extended Discussion: Test-time scaling trades additional inference computation for performance, with long CoT searching within a single response and response length often tracking improved reasoning.Other approaches include Self-Consistency, planning, and agentic prompting; long CoT is one specific form of inference-time scaling.
  • 9.8.4 Extended Discussion: Scaling RL training offers higher token efficiency and continued reasoning gains, with DeepSeek-R1-Zero improving consistently beyond 8,000 training steps.Heuristic methods and supervised fine-tuning show more limited performance ceilings, whereas RL scaling can continue improving reasoning models as training increases.

10 CONCLUSION AND FUTURE DIRECTIONS

This survey reviews LLM progress across pre-training, adaptation, utilization, and evaluation, focusing on models larger than 10B and summarizing development resources and implementation guidance. It identifies future challenges spanning principles, architectures, training, utilization, safety, alignment, and applications.

  • Survey Scope: The survey focuses on LLMs larger than 10B, covering pre-training, adaptation, utilization, evaluation, development resources, and implementation guidelines.It excludes early pretrained models such as BERT and GPT-2, which are well covered elsewhere.
  • Basics and Principles: Future work should explain how unsupervised pre-training, scaling, data, generalization, and contamination determine LLM capabilities and evaluation validity.The survey highlights capacity-selection mechanisms, theory connecting large and small models, and protocols for fair assessment.
  • Model Architecture: Transformer remains the dominant scalable architecture, but high costs, slow inference, weak long-context utilization, and decoder-only focus motivate architectural and hardware innovation.The survey specifically calls for improved architectures, system-level optimization, and methods that better process long-context information.
  • Model Training: Economical, reproducible pre-training requires data-centric pipelines, flexible resource scheduling, better training recipes, and continued adaptation of released checkpoints.Open issues include catastrophic forgetting, task specialization, and efficient knowledge injection or editing.
  • Model Utilization: Prompting, in-context learning, chain-of-thought, planning, and retrieval augmentation expand LLM utility, while prompt theory, inference cost, and long-context use remain unresolved.Retrieval augmentation can extend the knowledge boundary and improve question answering, but may be limited by ineffective long-context utilization.
  • Safety and Alignment: Hallucination, harmful outputs, bias, toxicity, misuse, and privacy require more efficient alignment, higher-quality feedback, red teaming, and privacy-preserving fine-tuning.The survey identifies RLHF’s dependence on costly professional annotation and points to simplified optimization and federated learning as practical directions.
  • Application and Ecosystem: LLMs are expected to reshape search, recommendation, autonomous agents, and application ecosystems while advancing AGI exploration, with AI safety remaining a primary concern.Examples include New Bing, Assistants API, and OpenAI’s GPT Store.

CODA

The authors present the survey as a timely, comprehensive reference that is continuously revised, while acknowledging omissions, non-rigorous discussions, and incomplete experiments. They invite reader feedback and plan future updates, including broader empirical results.

  • Survey Writing: The survey was extensively revised in several passes to summarize recent advances in large language models, while a more relaxed model-selection criterion was maintained on GitHub.The initial version appeared on March 31, 2023, followed by revisions on June 29, September 10, and November 23, 2023; a September 25, 2024 update is also recorded.
  • Seeking for Advice: The authors acknowledge that the survey may miss important references or topics and may contain non-rigorous expressions or discussions.They welcome constructive suggestions through GitHub or email and plan to incorporate them into future revisions.
  • Clarifications on Experiments: The included experiments cover instruction tuning, overall ability evaluation, and prompt engineering, but remain incomplete because of limited computational resources.The experiments are restricted to small-sized models or a few comparisons, with larger models and additional comparisons planned for future versions.
  • Chinese Book: The authors also released a Chinese book based on the survey, which is in the publication process.The book is available at the linked project website.
Loading 2303.18223v19…