LogoLogo
Continuum WebsiteContinuum ApplicationsContinuum KnowledgeAxolotl Platform
Continuum Knowledge
Continuum Knowledge
  • Continuum
  • Data
    • Datasets
      • Pre Training Data
      • Types of Fine Tuning
      • Self Instruct Paper
      • Self-Alignment with Instruction Backtranslation
      • Systematic Evaluation of Instruction-Tuned Large Language Models on Open Datasets
      • Instruction Tuning
      • Instruction Fine Tuning - Alpagasus
      • Less is More For Alignment
      • Enhanced Supervised Fine Tuning
      • Visualising Data using t-SNE
      • UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction
      • Training and Evaluation Datasets
      • What is perplexity?
  • MODELS
    • Foundation Models
      • The leaderboard
      • Foundation Models
      • LLama 2 - Analysis
      • Analysis of Llama 3
      • Llama 3.1 series
      • Google Gemini 1.5
      • Platypus: Quick, Cheap, and Powerful Refinement of LLMs
      • Mixtral of Experts
      • Mixture-of-Agents (MoA)
      • Phi 1.5
        • Refining the Art of AI Training: A Deep Dive into Phi 1.5's Innovative Approach
      • Phi 2.0
      • Phi-3 Technical Report
  • Training
    • The Fine Tuning Process
      • Why fine tune?
        • Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations?
        • Explanations in Fine Tuning
      • Tokenization
        • Tokenization Is More Than Compression
        • Tokenization - SentencePiece
        • Tokenization explore
        • Tokenizer Choice For LLM Training: Negligible or Crucial?
        • Getting the most out of your tokenizer for pre-training and domain adaptation
        • TokenMonster
      • Parameter Efficient Fine Tuning
        • P-Tuning
          • The Power of Scale for Parameter-Efficient Prompt Tuning
        • Prefix-Tuning: Optimizing Continuous Prompts for Generation
        • Harnessing the Power of PEFT: A Smarter Approach to Fine-tuning Pre-trained Models
        • What is Low-Rank Adaptation (LoRA) - explained by the inventor
        • Low Rank Adaptation (Lora)
        • Practical Tips for Fine-tuning LMs Using LoRA (Low-Rank Adaptation)
        • QLORA: Efficient Finetuning of Quantized LLMs
        • Bits and Bytes
        • The Magic behind Qlora
        • Practical Guide to LoRA: Tips and Tricks for Effective Model Adaptation
        • The quantization constant
        • QLORA: Efficient Finetuning of Quantized Language Models
        • QLORA and Fine-Tuning of Quantized Language Models (LMs)
        • ReLoRA: High-Rank Training Through Low-Rank Updates
        • SLoRA: Federated Parameter Efficient Fine-Tuning of Language Models
        • GaLora: Memory-Efficient LLM Training by Gradient Low-Rank Projection
      • Hyperparameters
        • Batch Size
        • Padding Tokens
        • Mixed precision training
        • FP8 Formats for Deep Learning
        • Floating Point Numbers
        • Batch Size and Model loss
        • Batch Normalisation
        • Rethinking Learning Rate Tuning in the Era of Language Models
        • Sample Packing
        • Gradient accumulation
        • A process for choosing the learning rate
        • Learning Rate Scheduler
        • Checkpoints
        • A Survey on Efficient Training of Transformers
        • Sequence Length Warmup
        • Understanding Training vs. Evaluation Data Splits
        • Cross-entropy loss
        • Weight Decay
        • Optimiser
        • Caching
      • Training Processes
        • Extending the context window
        • PyTorch Fully Sharded Data Parallel (FSDP)
        • Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
        • YaRN: Efficient Context Window Extension of Large Language Models
        • Sliding Window Attention
        • LongRoPE
        • Reinforcement Learning
        • An introduction to reinforcement learning
        • Reinforcement Learning from Human Feedback (RLHF)
        • Direct Preference Optimization: Your Language Model is Secretly a Reward Model
  • INFERENCE
    • Why is inference important?
      • Grouped Query Attention
      • Key Value Cache
      • Flash Attention
      • Flash Attention 2
      • StreamingLLM
      • Paged Attention and vLLM
      • TensorRT-LLM
      • Torchscript
      • NVIDIA L40S GPU
      • Triton Inference Server - Introduction
      • Triton Inference Server
      • FiDO: Fusion-in-Decoder optimised for stronger performance and faster inference
      • Is PUE a useful measure of data centre performance?
      • SLORA
  • KNOWLEDGE
    • Vector Databases
      • A Comprehensive Survey on Vector Databases
      • Vector database management systems: Fundamental concepts, use-cases, and current challenges
      • Using the Output Embedding to Improve Language Models
      • Decoding Sentence-BERT
      • ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT
      • SimCSE: Simple Contrastive Learning of Sentence Embeddings
      • Questions Are All You Need to Train a Dense Passage Retriever
      • Improving Text Embeddings with Large Language Models
      • Massive Text Embedding Benchmark
      • RocketQAv2: A Joint Training Method for Dense Passage Retrieval and Passage Re-ranking
      • LLM2Vec: Large Language Models Are Secretly Powerful Text Encoders
      • Embedding and Fine-Tuning in Neural Language Models
      • Embedding Model Construction
      • Demystifying Embedding Spaces using Large Language Models
      • Fine-Tuning Llama for Multi-Stage Text Retrieval
      • Large Language Model Based Text Augmentation Enhanced Personality Detection Model
      • One Embedder, Any Task: Instruction-Finetuned Text Embeddings
      • Vector Databases are not the only solution
      • Knowledge Graphs
        • Harnessing Knowledge Graphs to Elevate AI: A Technical Exploration
        • Unifying Large Language Models and Knowledge Graphs: A Roadmap
      • Approximate Nearest Neighbor (ANN)
      • High Dimensional Data
      • Principal Component Analysis (PCA)
      • Vector Similarity Search - HNSW
      • FAISS (Facebook AI Similarity Search)
      • Unsupervised Dense Retrievers
    • Retrieval Augmented Generation
      • Retrieval-Augmented Generation for Large Language Models: A Survey
      • Fine-Tuning or Retrieval?
      • Revolutionising Information Retrieval: The Power of RAG in Language Models
      • A Survey on Retrieval-Augmented Text Generation
      • REALM: Retrieval-Augmented Language Model Pre-Training
      • Retrieve Anything To Augment Large Language Models
      • Generate Rather Than Retrieve: Large Language Models Are Strong Context Generators
      • Active Retrieval Augmented Generation
      • DSPy: LM Assertions: Enhancing Language Model Pipelines with Computational Constraints
      • DSPy: Compiling Declarative Language Model Calls
      • DSPy: In-Context Learning for Extreme Multi-Label Classification
      • Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programs
      • HYDE: Revolutionising Search with Hypothetical Document Embeddings
      • Enhancing Recommender Systems with Large Language Model Reasoning Graphs
      • Retrieval Augmented Generation (RAG) versus fine tuning
      • RAFT: Adapting Language Model to Domain Specific RAG
      • Summarisation Methods and RAG
      • Lessons Learned on LLM RAG Solutions
      • Stanford: Retrieval Augmented Language Models
      • Overview of RAG Approaches with Vector Databases
      • Mastering Chunking in Retrieval-Augmented Generation (RAG) Systems
    • Semantic Routing
    • Resource Description Framework (RDF)
  • AGENTS
    • What is agency?
      • Rephrase and Respond: Let Large Language Models Ask Better Questions for Themselves
      • Types of Agents
      • The risk of AI agency
      • Understanding Personality in Large Language Models: A New Frontier in AI Psychology
      • AI Agents - Reasoning, Planning, and Tool Calling
      • Personality and Brand
      • Agent Interaction via APIs
      • Bridging Minds and Machines: The Legacy of Newell, Shaw, and Simon
      • A Survey on Language Model based Autonomous Agents
      • Large Language Models as Agents
      • AI Reasoning: A Deep Dive into Chain-of-Thought Prompting
      • Enhancing AI Reasoning with Self-Taught Reasoner (STaR)
      • Exploring the Frontier of AI: The "Tree of Thoughts" Framework
      • Toolformer: Revolutionising Language Models with API Integration - An Analysis
      • TaskMatrix.AI: Bridging Foundational AI Models with Specialised Systems for Enhanced Task Completion
      • Unleashing the Power of LLMs in API Integration: The Rise of Gorilla
      • Andrew Ng's presentation on AI agents
      • Making AI accessible with Andrej Karpathy and Stephanie Zhan
  • Regulation and Ethics
    • Regulation and Ethics
      • Privacy
      • Detecting AI Generated content
      • Navigating the IP Maze in AI: The Convergence of Blockchain, Web 3.0, and LLMs
      • Adverse Reactions to generative AI
      • Navigating the Ethical Minefield: The Challenge of Security in Large Language Models
      • Navigating the Uncharted Waters: The Risks of Autonomous AI in Military Decision-Making
  • DISRUPTION
    • Data Architecture
      • What is a data pipeline?
      • What is Reverse ETL?
      • Unstructured Data and Generatve AI
      • Resource Description Framework (RDF)
      • Integrating generative AI with the Semantic Web
    • Search
      • BM25 - Search Engine Ranking Function
      • BERT as a reranking engine
      • BERT and Google
      • Generative Engine Optimisation (GEO)
      • Billion-scale similarity search with GPUs
      • FOLLOWIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions
      • Neural Collaborative Filtering
      • Federated Neural Collaborative Filtering
      • Latent Space versus Embedding Space
      • Improving Text Embeddings with Large Language Models
    • Recommendation Engines
      • On Interpretation and Measurement of Soft Attributes for Recommendation
      • A Survey on Large Language Models for Recommendation
      • Model driven recommendation systems
      • Recommender AI Agent: Integrating Large Language Models for Interactive Recommendations
      • Foundation Models for Recommender Systems
      • Exploring the Impact of Large Language Models on Recommender Systems: An Extensive Review
      • AI driven recommendations - harming autonomy?
    • Logging
      • A Taxonomy of Anomalies in Log Data
      • Deeplog
      • LogBERT: Log Anomaly Detection via BERT
      • Experience Report: Deep Learning-based System Log Analysis for Anomaly Detection
      • Log-based Anomaly Detection with Deep Learning: How Far Are We?
      • Deep Learning for Anomaly Detection in Log Data: A Survey
      • LogGPT
      • Adaptive Semantic Gate Networks (ASGNet) for log-based anomaly diagnosis
  • Infrastructure
    • The modern data centre
      • Enhancing Data Centre Efficiency: Strategies to Improve PUE
      • TCO of NVIDIA GPUs and falling barriers to entry
      • Maximising GPU Utilisation with Kubernetes and NVIDIA GPU Operator
      • Data Centres
      • Liquid Cooling
    • Servers and Chips
      • The NVIDIA H100 GPU
      • NVIDIA H100 NVL
      • Lambda Hyperplane 8-H100
      • NVIDIA DGX Servers
      • NVIDIA DGX-2
      • NVIDIA DGX H-100 System
      • NVLink Switch
      • Tensor Cores
      • NVIDIA Grace Hopper Superchip
      • NVIDIA Grace CPU Superchip
      • NVIDIA GB200 NVL72
      • Hopper versus Blackwell
      • HGX: High-Performance GPU Platforms
      • ARM Chips
      • ARM versus x86
      • RISC versus CISC
      • Introduction to RISC-V
    • Networking and Connectivity
      • Infiniband versus Ethernet
      • NVIDIA Quantum InfiniBand
      • PCIe (Peripheral Component Interconnect Express)
      • NVIDIA ConnectX InfiniBand adapters
      • NVMe (Non-Volatile Memory Express)
      • NVMe over Fabrics (NVMe-oF)
      • NVIDIA Spectrum-X
      • NVIDIA GPUDirect
      • Evaluating Modern GPU Interconnect
      • Scalable Hierarchical Aggregation and Reduction Protocol (SHARP)
      • Next-generation networking in AI environments
      • NVIDIA Collective Communications Library (NCCL)
    • Data and Memory
      • NVIDIA BlueField Data Processing Units (DPUs)
      • Remote Direct Memory Access (RDMA)
      • High Bandwidth Memory (HBM3)
      • Flash Memory
      • Model Requirements
      • Calculating GPU memory for serving LLMs
      • Transformer training costs
      • GPU Performance Optimisation
    • Libraries and Complements
      • NVIDIA Base Command
      • NVIDIA AI Enterprise
      • CUDA - NVIDIA GTC 2024 presentation
      • RAPIDs
      • RAFT
    • Vast Data Platform
      • Vast Datastore
      • Vast Database
      • Vast Data Engine
      • DASE (Disaggregated and Shared Everything)
      • Dremio and VAST Data
    • Storage
      • WEKA: A High-Performance Storage Solution for AI Workloads
      • Introduction to NVIDIA GPUDirect Storage (GDS)
        • GDS cuFile API
      • NVIDIA Magnum IO GPUDirect Storage (GDS)
      • Vectors in Memory
Powered by GitBook
LogoLogo

Continuum - Accelerated Artificial Intelligence

  • Continuum Website
  • Axolotl Platform

Copyright Continuum Labs - 2023

On this page
  • Method
  • Experiments
  • Related Work
  • Conclusion

Was this helpful?

  1. Data
  2. Datasets

Self-Alignment with Instruction Backtranslation

Xian Li, Ping Yu, Chunting Zhou, Timo Schick, Omer Levy, Luke Zettlemoyer, Jason Weston, Mike Lewis

PreviousSelf Instruct PaperNextSystematic Evaluation of Instruction-Tuned Large Language Models on Open Datasets

Last updated 1 year ago

Was this helpful?

In this March 2024 paper, the authors introduce a novel method called "instruction backtranslation" to create high-quality instruction-following language models without relying on large amounts of human-annotated data. The approach leverages a small amount of seed data and a large web corpus to automatically generate and curate training examples.

The key steps of the instruction backtranslation method are as follows:

Self-augmentation: The seed model generates instruction prompts for web documents, creating potential training examples.

Self-curation: The seed model selects high-quality examples from the generated candidates.

Fine-tuning: The selected high-quality examples are used to fine-tune a stronger model.

Iteration: The process is repeated, using the improved model to better curate the instruction data and re-train the model.

The authors highlight the importance of data quality in aligning large language models (LLMs) for instruction following.

While human-annotated datasets are valuable, they are difficult to scale. The instruction backtranslation method addresses this challenge by leveraging the model itself to augment and curate training examples, enabling self-alignment.

The approach draws inspiration from the backtranslation method in machine translation, where target sentences are automatically annotated with model-generated source sentences in another language. In this case, the model generates instruction prompts for web documents and selects high-quality (instruction, output) pairs for training.

The authors demonstrate the effectiveness of their approach by fine-tuning LLaMa on two iterations of instruction backtranslation. The resulting model, named Humpback, outperforms all other non-distilled models on the Alpaca leaderboard, showcasing the power of self-alignment through iterative self-augmentation and self-curation.

Method

The instruction backtranslation method consists of two main steps: self-augmentation and self-curation. The process is iterative, allowing the model to improve its ability to select high-quality examples for fine-tuning. Let's break down each step in detail:

Initialization

  • Start with a base language model (e.g., LLaMa), a small seed dataset of human-annotated (instruction, output) pairs, and a large unlabeled web corpus.

  • Preprocess the web corpus by extracting self-contained segments, deduplicating, filtering by length, and removing low-quality segments.

Self-Augmentation

  • Fine-tune the base language model on (output, instruction) pairs from the seed data to create a backward model Myx, which predicts instructions given outputs.

  • For each unlabeled example yi in the web corpus, use the backward model to generate a candidate instruction ˆxi.

  • Create candidate augmented paired data A := {(ˆxi, yi)} by combining the generated instructions with their corresponding outputs.

Self-Curation

  • Start with a seed instruction model M0 fine-tuned on (instruction, output) pairs from the seed data.

  • Use M0 to score each augmented example (ˆxi, yi) in A and derive a quality score ai using prompting (e.g., instructing the model to rate the quality on a 5-point scale).

  • Select a subset of the augmented examples with scores ai ≥ k to form a curated set A(1)k.

Iterative Self-Curation

  • Use the curated augmentation data A(t-1)k from the previous iteration, along with the seed data, to fine-tune an improved model Mt.

  • Use Mt to rescore the augmented examples for quality, resulting in a new augmentation set A(t)k.

  • Perform multiple iterations of data selection and fine-tuning to obtain the final model (e.g., M2 after two iterations).

  • When combining seed data and augmented data for fine-tuning, use tagging to distinguish the data sources (e.g., append "Answer in the style of an AI Assistant." for seed data and "Answer with knowledge from web search." for augmented data).

Example of emulating the process

  1. Start with a base model like GPT-3 and a small seed dataset of human-annotated (instruction, output) pairs, along with a large web corpus like Common Crawl.

  2. Fine-tune GPT-3 on (output, instruction) pairs from the seed data to create a backward model that predicts instructions given outputs.

  3. For each document in the web corpus, extract self-contained segments and use the backward model to generate candidate instructions for each segment.

  4. Create candidate augmented paired data by combining the generated instructions with their corresponding segments.

  5. Fine-tune a seed instruction model (e.g., GPT-3) on the (instruction, output) pairs from the seed data.

  6. Use the seed instruction model to score each augmented example using prompting (e.g., "On a scale of 1 to 5, how well does the output answer the given instruction?").

  7. Select a subset of the augmented examples with scores above a certain threshold (e.g., 4 or 5) to form a curated set.

  8. Fine-tune the seed instruction model on the curated set, along with the seed data, to create an improved model.

  9. Use the improved model to rescore the augmented examples and create a new curated set.

  10. Repeat steps 8 and 9 for multiple iterations to obtain the final instruction-following model.

By emulating this process, you can leverage large amounts of unlabeled data to create high-quality instruction-following models without relying heavily on human annotation.

Experiments

The experiments in this paper aim to evaluate the effectiveness of the proposed instruction backtranslation method for training instruction-following language models. The authors conducted several experiments to analyze the impact of data quality, data quantity, and various ablations. Let's break down the experiments in detail:

Experimental Setup

  • Seed data: 3,200 high-quality (instruction, output) pairs from the first turn of the Open Assistant dataset.

  • Base model: LLaMA with 7B, 33B, and 65B parameters, fine-tuned using the same hyperparameters as existing supervised fine-tuning methods.

  • Unlabeled data: 502k segments from the English portion of the Clueweb corpus.

  • Baselines: text-davinci-003, LIMA, and Guanaco.

  • Evaluation: 1,130 unique prompts from various sources, with a dev set of 256 prompts. Automatic evaluation using AlpacaEval and human preference evaluation.

Seed and Augmentation Data Statistics

  • Analysis of instruction and output lengths for seed data, self-augmented data, and self-curated data.

  • Task diversity analysis using the verb-noun structure of instructions.

Scaling Analysis

  • Data quality vs. data quantity: Fine-tuning on augmented data of different quality (without curation, A(2)4, and A(2)5) to understand the importance of data quality.

  • Data scaling efficiency: Comparing the performance of various instruction-following models as the amount of fine-tuning data changes. Estimating the scaling coefficient α for different instruction datasets.

Model Quality

  • AlpacaEval: Evaluating the generation quality using GPT-4 as the judge, comparing Humpback to non-distilled, distilled, and proprietary models.

  • Human Evaluation: Pairwise comparison of Humpback with open-source and proprietary models using human preference judgments.

  • Commonsense Reasoning and MMLU: Zero-shot accuracy on five commonsense reasoning benchmarks and the Massive Multitask Language Understanding (MMLU) benchmark.

Ablations

  • Training on self-augmented data only: Comparing the performance of models trained on self-augmented data with and without self-curation, and jointly fine-tuning with seed data.

  • System prompts: Analyzing the effects of using system prompts to distinguish augmented data from seed data during fine-tuning and inference.

The experiments demonstrate that the proposed instruction backtranslation method, using self-augmentation and self-curation, can effectively leverage large amounts of unlabeled data to create high-quality instruction-following models. The results show that Humpback outperforms other non-distilled models and achieves competitive performance compared to distilled and proprietary models. The ablation studies further confirm the importance of self-curation and the complementary nature of seed data and augmented data.

Related Work

The related work section discusses various approaches to instruction tuning for large language models (LLMs) and the challenges in gathering high-quality demonstration examples for fine-tuning.

Early work on instruction tuning focused on NLP tasks, showing that fine-tuning with instruction-output pairs improves cross-task generalization. Recent work has extended instruction tuning to a broader range of general tasks, incorporating instructions from LLM users.

Existing high-quality instruction-following LLMs rely on human annotations, which are expensive and time-consuming to collect. Some works have explored using LLMs to generate instructions, such as Unnatural Instructions, Self-Instruct, and the concurrent work by Köksal et al. (2023). However, these approaches either use model-generated responses for training data or rely on distillation from a more powerful model.

The authors also discuss self-alignment, where the model is utilized to improve itself and align its responses with desired behaviors. Many of these works construct training data in an unsupervised way or use the model to generate additional context to condition on at inference time.

The importance of data quality is highlighted, with approaches like PALMS and LIMA showing that curating high-quality human-written data results in strong performance. The concurrent work by Chen et al. (2023) provides an algorithmic approach to select high-quality data.

Finally, the authors discuss distillation, where most fine-tuned LLaMA models are based on knowledge distillation from ChatGPT or GPT-4. These approaches require an already strong model and do not provide a recipe for building a strong model from scratch.

Conclusion

In conclusion, the proposed instruction backtranslation method offers a scalable approach to fine-tuning large language models for instruction following. By leveraging large amounts of unlabeled data and using the model itself to augment and curate high-quality training examples, this iterative self-training algorithm enables the creation of strong instruction-following models without relying heavily on human annotations or distillation from more powerful models.

The experiments demonstrate that the Humpback models, fine-tuned using instruction backtranslation, outperform all other non-distilled instruction-following models on the Alpaca leaderboard while using fewer human-annotated examples. This showcases the effectiveness of the self-augmentation and self-curation steps in improving the model's performance.

The analysis suggests that scaling this method further by considering larger unlabeled corpora could yield even greater gains. As the field of instruction tuning for LLMs continues to evolve, the instruction backtranslation approach presents a promising direction for creating high-quality, general-purpose instruction-following models in a more efficient and cost-effective manner.

Future research should explore the application of this method to larger datasets, investigate ways to further refine the self-curation process, and examine the potential for combining instruction backtranslation with other techniques, such as self-alignment and data quality optimization. By continuing to develop and improve methods like instruction backtranslation, researchers can work towards creating more capable and versatile language models that can better understand and follow a wide range of instructions.

Page cover image
LogoSelf-Alignment with Instruction BacktranslationarXiv.org
Self-Alignment with Instruction Backtranslation