TL;DR
InternLM2 is a new open-source Large Language Model (LLM) that pushes the boundaries of what's possible in the open-source community. It achieves state-of-the-art performance across a wide range of benchmarks, excels at handling extremely long contexts (up to 200k tokens), and introduces innovative techniques for alignment with human preferences.
What Problem Does This Paper Address?
The paper addresses the challenge of replicating the advanced capabilities of proprietary LLMs like ChatGPT and GPT-4 in the open-source domain. While many open-source LLMs have made strides, achieving comparable performance across comprehensive evaluations, handling long contexts effectively, and aligning with nuanced human preferences has remained a significant hurdle. The authors aim to bridge this gap by introducing InternLM2 and detailing its development process.
Methods
InternLM2's development involved several key stages and novel techniques:
- Innovative Pre-training: The model was trained on a massive corpus of diverse data, including text, code, and crucially, long-context data. A phased approach was used, starting with 4k tokens and progressing to 32k tokens, with positional encoding extrapolation enabling performance on up to 200k tokens.
- Grouped-Query Attention (GQA): This technique was employed to reduce memory footprint during inference, especially for long sequences.
- Supervised Fine-Tuning (SFT): The model was fine-tuned on a large dataset of instruction-following data to improve its ability to respond to human instructions.
- Conditional Online Reinforcement Learning from Human Feedback (COOL RLHF): This novel alignment strategy addresses two major issues in RLHF:
- Preference Conflicts: A conditional reward model reconciles diverse and potentially conflicting human preferences (e.g., helpfulness vs. harmlessness).
- Reward Hacking: A multi-round online RLHF approach helps the model adapt to feedback and mitigate reward hacking.
- InternEvo Framework: An efficient and scalable training framework was used, supporting advanced parallelism techniques (data, tensor, sequence, pipeline) and memory optimization strategies.
Datasets
- Pre-training Data: Diverse sources including web pages (Common Crawl), papers, patents, books, and technical literature were used.
- Code Data: Collected from GitHub, public datasets, and online coding resources.
- Long Context Data: A subset of the pre-training corpus, specifically curated for long text.
- Capability Specific Enhancement Data: A 24 billion token dataset comprising high-quality retrieved data and open-source data from Hugging Face, focusing on reasoning, math, and knowledge.
- SFT Data: 10 million instruction data instances covering general conversation, NLP tasks, math, code generation, and function calls.
- RLHF Data: Human preference data collected through various stages of training.
- Evaluation Benchmarks: A comprehensive set of 30 benchmarks across 6 dimensions, including MMLU, CMMLU, C-Eval, AGIEval, GAOKAO, TriviaQA, Natural Questions, C3, RACE-High, FLORES, GSM8K, MATH, TheoremQA, MathBench, HumanEval, MBPP, L-Eval, LongBench, and Needle-in-a-Haystack.
Key Insights and Ideas
- Phased Context Window Expansion: The strategy of gradually increasing the context window from 4k to 32k during pre-training, combined with positional encoding extrapolation, is highly effective for achieving long-context capabilities.
- COOL RLHF for Robust Alignment: The proposed COOL RLHF strategy offers a promising solution to the inherent challenges of preference conflicts and reward hacking in RLHF, leading to more reliable and aligned models.
- Importance of Data Quality and Diversity: The paper emphasizes the critical role of meticulously prepared and diverse datasets (text, code, long-context, and specialized enhancement data) in achieving high performance across various tasks.
- Open-Sourcing for Community Advancement: By releasing models at different training stages and sizes, the authors aim to foster research and provide valuable insights into LLM development.
Key Results
- State-of-the-Art Performance: InternLM2 outperforms existing open-source models across a wide range of benchmarks, including comprehensive examinations, language and knowledge tasks, reasoning, mathematics, and coding.
- Exceptional Long-Context Handling: The model demonstrates remarkable performance on the 200k "Needle-in-a-Haystack" test, nearly perfectly identifying crucial information within extremely long texts.
- Improved Alignment: The COOL RLHF strategy leads to significant improvements in subjective evaluations, demonstrating better alignment with human preferences.
- Efficiency Gains: The InternEvo framework and GQA contribute to efficient training and inference, especially for long contexts.
Limitations and Future Work
- Data Contamination: The paper discusses the potential issue of data contamination in LLMs and its impact on evaluation, suggesting further investigation into this area.
- Performance Gap in Other Languages: While strong in Chinese, the model's performance in other languages might be slightly less effective, potentially due to fine-tuning choices.
- Future Work: The authors plan to release checkpoints from various training phases to facilitate community research and provide insights into model evolution. They also aim to further investigate the performance differences across model sizes and explore more advanced alignment strategies.
Summary updated