Source-linked AI summary
Llama 2: Open Foundation and Fine-Tuned Chat Models
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller, Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez, Madian Khabsa, Isabel Kloumann, Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov, Pushkar Mishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith, Ranjan Subramanian, Xiaoqing Ellen Tan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu, Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan, Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, Thomas Scialom
TL;DR
공개 출시된 LLM은 closed-source chat model의 대체재로서 적합성이 제한적이었다. 이 논문은 Llama 2와 Llama 2-Chat을 개발·출시하며, 두 모델은 기존 open-source model을 전반적으로 능가하고 테스트한 평가에서 일부 closed-source model과 비슷한 성능을 보인다.
문제
공개 출시된 pretrained LLM은 closed-source model의 대체재로서 적합성이 제한적이었다.
방법
이 논문은 safety-specific tuning, red-teaming, iterative evaluation을 활용해 7B–70B 규모의 pretrained 및 dialogue-optimized fine-tuned model을 개발·출시한다.
결과
Llama 2-Chat은 기존 open-source model을 전반적으로 능가하며, 테스트한 helpfulness 및 safety evaluation에서 일부 closed-source model과 비슷한 성능을 보인다.
시사점 및 한계
이 논문은 community research와 responsible development를 위해 공개적으로 접근 가능한 model과 상세한 fine-tuning 및 safety method를 제공한다.
시사점 및 한계
Llama 2-Chat에는 outdated knowledge, 자격을 갖추지 않은 조언, hallucination을 비롯한 한계가 여전히 존재한다.
Abstract
from arXiv · showhide
In this work, we develop and release Llama 2, a collection of pretrained and fine-tuned large language models (LLMs) ranging in scale from 7 billion to 70 billion parameters. Our fine-tuned LLMs, called Llama 2-Chat, are optimized for dialogue use cases. Our models outperform open-source chat models on most benchmarks we tested, and based on our human evaluations for helpfulness and safety, may be a suitable substitute for closed-source models. We provide a detailed description of our approach to fine-tuning and safety improvements of Llama 2-Chat in order to enable the community to build on our work and contribute to the responsible development of LLMs.
1 서론
이 논문은 최대 70B parameters를 지원하는 pretrained 및 dialogue-optimized LLM 계열인 Llama 2와 Llama 2-Chat을 소개하고 공개한다. Llama 2-Chat은 테스트한 helpfulness 및 safety benchmark에서 기존 open-source model을 대체로 능가하며, human evaluation에서는 일부 closed-source model과 유사한 수준을 보인다. 다만 배포 전 애플리케이션별 safety testing이 필요하다.
- 기여: Llama 2-Chat은 테스트한 helpfulness 및 safety benchmark에서 기존 open-source model을 대체로 능가하며, human evaluation에서는 일부 closed-source model과 대등한 수준을 보인다.이러한 평가 결과는 Figures 1 and 3을 참조하도록 안내한다.
- 기여: 이 연구는 최대 70B parameters에 걸쳐 pretrained 및 fine-tuned LLM으로 구성된 계열인 Llama 2와 Llama 2-Chat을 개발하고 공개한다.Llama 2-Chat은 dialogue use case에 최적화되었다.
- 공개 모델: 공개된 Llama 2 변형은 7B, 13B, 70B parameters를 사용하며, 34B variant도 보고되었지만 red-teaming이 충분히 이루어지지 않아 공개되지 않았다.Llama 2는 새롭게 공개된 data mix, 40% 더 큰 pretraining corpus, 두 배로 늘어난 context length, grouped-query attention도 사용한다.
- 한계: 테스트가 영어로 수행되었고 모든 시나리오를 포괄할 수 없었으므로, 개발자는 각 Llama 2-Chat 애플리케이션에 맞춘 safety testing 및 tuning을 수행해야 한다.논문은 모든 LLM과 마찬가지로 Llama 2에도 잠재적 위험이 있음을 인정한다.
2 사전학습
Llama 2 사전학습은 2조 토큰, 더 긴 context, grouped-query attention을 포함한 개선된 데이터 및 architecture recipe를 결합하며, base model은 대부분의 학술 benchmark 범주에서 기존 및 유사한 open-source model보다 우수한 성능을 보인다. Llama 2 70B는 MMLU와 GSM8K에서 GPT-3.5에 근접하고 거의 모든 benchmark에서 PaLM과 대등하거나 더 우수하지만, GPT-4와 PaLM-2-L에는 여전히 뒤처진다.
- 사전학습 접근법: 사전학습 recipe는 더 큰 model에서 inference 확장성을 높이기 위해 40% 더 많은 token, 두 배로 늘어난 context 길이, 더욱 견고한 data cleaning, 업데이트된 data mix, grouped-query attention을 사용한다.model은 Llama 1의 transformer architecture 대부분을 채택하면서 context 길이를 늘리고 GQA를 추가한다. 34B와 70B model은 향상된 inference 확장성을 위해 GQA를 사용한다.
- 사전학습 데이터: corpus는 공개적으로 이용 가능한 출처에서 수집한 2조 token으로 구성되며, Meta 제품과 서비스는 제외하고, 상당한 private information이 포함된 일부 site의 data를 제거하며, 지식 향상과 hallucination 완화를 위해 factual source를 up-sample한다.저자들은 이 token 수가 성능과 비용 사이의 양호한 절충이라고 설명한다.
- 학습 infrastructure와 탄소 발자국: 사전학습에는 3.3M A100-80GB GPU 시간이 사용되었고 추정 539 tCO2eq가 발생했으며, 이는 모두 Meta의 sustainability program을 통해 직접 상쇄되었다.open release 전략에 따라 다른 회사는 이러한 사전학습 비용을 부담할 필요가 없다.
- 학술 benchmark 결과: Llama 2 model은 Llama 1 model보다 우수한 성능을 보이며, Llama 2 70B는 Llama 1 65B보다 MMLU와 BBH에서 각각 ≈5와 ≈8 point 향상되었다. 또한 Llama 2 70B는 모든 open-source model보다 우수하다.Llama 2 7B와 30B는 code를 제외한 모든 범주에서 같은 규모의 MPT model보다 우수하며, Llama 2 7B와 34B는 모든 범주에서 Falcon 7B와 40B보다 우수하다.
- 학술 benchmark 결과: Llama 2 70B는 MMLU와 GSM8K에서 GPT-3.5에 근접하고, 거의 모든 benchmark에서 PaLM (540B)과 대등하거나 더 우수하지만, GPT-3.5에 비해 coding 격차가 상당하고 GPT-4와 PaLM-2-L에 비해서는 큰 격차가 있다.비교에는 Table 4에 요약된 closed-source 학술 benchmark 결과가 사용되었다.
3 미세 조정
Section 3은 대화 턴 전반에 걸쳐 지시를 유지하기 위한 supervised fine-tuning, reward modeling, RLHF, Ghost Attention 실험을 보고한다. Llama 2-Chat은 open-source chat models보다 크게 향상되며, GAtt는 지속적인 multi-turn 제어를 가능하게 한다.
- Reward modeling: Reward models는 각각 대응하는 Helpfulness 및 Safety test sets에서 가장 우수한 성능을 보이며, GPT-4를 포함한 모든 baseline보다 뛰어나다. 이는 두 목표 사이의 긴장을 반영한다.서로 더 구별되는 response pairs일수록 더 큰 margin을 사용하면 Helpfulness reward-model accuracy가 향상되며, annotation data가 증가함에 따라 더 큰 models의 성능도 계속 향상된다.
- RLHF와 Rejection Sampling: Rejection Sampling은 sampled outputs의 수가 증가할수록 더 큰 potential reward를 얻는 반면, RLHF는 10–100 outputs에 대해 최적 sampling temperature를 T ∈[1.2, 1.3]로 변경한다.Rejection Sampling은 fine-tuning 전에 여러 outputs를 탐색하는 반면, PPO는 training 중 policy를 업데이트하고 prompt당 하나의 output을 sampling한다.
- Ghost Attention: Ghost Attention (GAtt)은 fine-tuning 중 persistent instruction을 user messages에 연결하며, context limit에 도달할 때까지 20+ turns 동안 dialogue control을 유지한다.GAtt는 RLHF V3 이후 적용되었으며, “Always answer with Haiku.”와 같이 inference time에만 도입된 instruction도 유지했다.
- Ghost Attention: GAtt는 더 많은 dialogue turns에 걸쳐 system message에 대한 더 큰 attention activations를 유지하여, 초기 RLHF models가 persistent instructions를 잊는 경향을 해결한다.이 방법은 Context Distillation (Bai et al., 2022b)에서 영감을 받았다.
- Model progression and evaluation: RLHF-V3 이후 Llama 2-Chat은 in-house Safety 및 Helpfulness axes 모두에서 ChatGPT를 능가하지만, reward-based evaluation은 Llama 2-Chat에 유리할 수 있다.저자들은 주요 versions를 human evaluation으로 검증하기 전에 reward improvements를 사용해 중간 RLHF versions를 선택한다.
- Model progression and evaluation: ChatGPT와 비교해 36% win rate와 31.5% tie rate를 보였으며, Llama 2-Chat 7B는 prompts의 60%에서 MPT-7B-chat보다 우수하고 34B는 Vicuna-33B 및 Falcon 40B에 대해 75%를 넘는 win rate를 기록한다.Llama 2-Chat 70B도 평가된 prompt set에서 PaLM-bison chat보다 큰 비율로 우수하다.
4 안전성
Llama 2의 안전성 작업은 선제적 red teaming, safety fine-tuning, context distillation, truthfulness·toxicity·bias·adversarial robustness 평가를 결합한다. Fine-tuning한 Llama 2-Chat은 pretrained Llama 2보다 truthfulness와 toxicity를 크게 개선하면서도 long-tail, multi-turn, context-specific 위험에는 여전히 취약하다.
- Safety Fine-Tuning: Llama 2-Chat은 수천 개의 안전한 demonstration만으로 일반화해, 상세한 안전 응답을 생성하고 민감한 사안을 다루며 유용한 추가 정보를 제공한다.안전 응답은 평균 annotator가 작성한 응답보다 더 상세한 경우가 많았다.
- Safety RLHF: Safety RLHF는 safety 및 helpfulness reward model을 사용해 adversarial prompt의 유무에 따른 checkpoint를 테스트함으로써 helpfulness를 유지하면서 long-tail safety robustness를 개선했다.이 비교는 Figure 14에서 score distribution의 이동으로 제시된다.
- Adversarial Robustness: Context distillation과 safety preprompt는 adversarial prompt에 대한 더 안전한 응답을 효율적으로 bootstrap하는 한편, red teaming은 초기 모델을 상대로 한 creative-writing 및 positive-context 공격을 드러냈다.후속 모델은 문제가 있는 콘텐츠를 더 자주 인식했으며, 최신 모델은 이를 그대로 제공하려는 초기 경향을 해소했다.
- Red Teaming: Red-team refinement를 반복한 결과 7B 모델의 violation을 유발하는 prompt 비율 γ가 반복 과정에서 1.8에서 0.45로 감소했다.수개월에 걸친 여러 차례의 레드팀 평가를 통해 전문가 한 명당 시간당 생성된 위반 프롬프트의 평균 개수로 강건성을 측정했다.
- Safety Evaluation: Multi-turn 대화는 single-turn 대화보다 violation을 유발할 가능성이 높았지만, Llama 2-Chat은 특히 multi-turn 환경에서 baseline과 비교해 우수한 성능을 보였다.범주 전반에서 Llama 2-Chat의 주요 약점은 조건을 명시하지 않은 조언이었으며, 다른 범주에서는 violation rate가 comparable하거나 더 낮았다.
- Truthfulness, Toxicity, and Bias: Fine-tuning 후 70B의 truthfulness는 50.18에서 64.14로 향상되었고 toxicity는 24.60에서 0.01로 감소했다. Llama 2-Chat은 Falcon 및 MPT와 비교해 toxicity와 truthfulness 성능 모두에서 최고 수준을 달성했다.모든 Llama 2-Chat 크기에서 toxic generation이 사실상 0%로 감소해, 비교 모델 중 가장 낮은 toxicity 수준을 보였다.
5 논의
논의에서는 RLHF와 관련된 창발적 능력과 메커니즘으로 문맥 의존적 다양성, 시간적 구성, zero-shot 도구 사용을 강조한다. 또한 사실성, 언어 범위, 유해 콘텐츠, 오용, 과도하게 신중한 안전 행동과 관련된 한계를 확인한다.
- 5.1 RLHF 특성: RLHF는 매우 효과적이고 비용 및 시간 효율적이었으며, 이러한 성공은 모델 능력과 인간 선호 피드백 간 시너지에 기인한다.선호도 비교를 통해 reward model은 품질이 낮은 출력을 식별하는 동시에, 모델이 annotation 담당자 자신의 작성 능력을 넘어서는 작성 궤적을 탐색할 수 있게 한다.
- 5.1 RLHF 특성: RLHF는 prompt 유형에 따라 temperature를 동적으로 재조정해 사실적 응답에서는 다양성을 줄이고 창의적 생성에서는 다양성을 유지한다.Figure 21은 temperature 전반에서 창의적 지시 10개와 사실적 지시 10개를 평가하고, 각 설정에서 응답 25개를 sample한다.
- 5.1 RLHF 특성: 날짜에 초점을 둔 SFT 예시가 1,000개뿐이었음에도 Llama 2-Chat은 지식을 시간적으로 견고하게 구성했으며, 이는 언어 모델이 next-token training data가 섞여 있어도 시간을 내부화한다는 점을 시사한다.저자들은 수십 개의 예시를 수동으로 테스트했고 일관된 시간적 일반화를 관찰했다.
- 5.1 RLHF 특성: 도구 사용은 alignment로부터 zero-shot으로 창발했으며, Llama 2-Chat은 도구 적용과 API argument를 추론하고 명시적인 도구 사용 annotation 없이도 연속된 작업을 실행할 수 있었다.이는 개별 도구에 대해 수백만 개의 궤적과 few-shot 예시를 요구하는 접근법과 대조된다.
- 5.2 한계: Llama 2-Chat은 최신이 아닌 지식, 사실이 아닌 조언, hallucination, 유해하거나 편향된 출력, misinformation 또는 cybercrime에 악용될 가능성을 포함한 일반적인 LLM 한계를 유지한다.Fine-tuning으로 일부 유해 행동이 감소했지만, 특히 비영어권 safety data가 제한적인 경우 해결되지 않은 위험이 남아 있다.
- 5.2 한계: 영어 이외의 언어에서 성능은 여전히 취약한 반면, safety tuning은 무해한 요청을 거절하거나 과도한 안전 세부사항을 제공하는 등 지나치게 신중해질 수 있다.초기 모델은 제한적인 비영어권 pretraining data를 사용했으며, 저자들은 추가적인 safety 연구와 업데이트된 release가 필요하다는 점을 인정한다.
6 관련 연구
관련 연구는 대규모 언어 모델의 발전, instruction tuning과 RLHF, 그리고 tuning된 시스템 배포와 관련된 안전 위험을 포괄한다. instruction tuning, preference optimization, synthetic-feedback 방법은 alignment를 개선하지만, open-source 모델은 대체로 production-ready closed-source 시스템보다 뒤처져 있으며 LLM은 여전히 상당한 안전 과제를 제기한다.
- 대규모 언어 모델: 대규모 언어 모델은 100B parameters를 넘어 확장되었으며, Chinchilla (Hoffmann et al., 2022)는 scaling-law의 관심을 model size보다 token counts로 돌렸다.예로는 GPT-3 (Brown et al., 2020), Gopher, 그리고 특화된 scientific model인 Galactica (Taylor et al., 2022)가 있다.
- 대규모 언어 모델: ChatGPT, Bard, Claude와 같은 production-ready 시스템은 open source에서 아직 활발히 개발 중인 정교한 human-preference alignment 기법을 사용하기 때문에 performance와 usability에서 크게 다르다.open-source alignment 방법은 계속 탐색되고 정교화되고 있다 (Gudibande et al., 2023).
- 대규모 언어 모델: Vicuna 와 Alpaca 같은 distillation-based 모델은 synthetic instructions를 사용하지만 여전히 closed-source 모델에 미치지 못한다.이들의 training approach는 synthetic instructions에 기반한다 (Honovich et al., 2022; Wang et al., 2022).
- Instruction Tuning: Instruction tuning은 보지 못한 task에서 zero-shot performance를 가능하게 하며, 그 효과는 task count, model size, prompt settings, 그리고 human- 또는 model-generated prompts에 걸쳐 연구되었다.후속 instructions는 초기 generations를 정교화하여 더 유용하고, 매력적이며, u…하게 만들 수 있다.
- Instruction Tuning: RLHF는 human feedback으로 모델을 fine-tune하여 응답을 user expectations에 맞추며, instruction tuning과 RLHF를 결합하면 scaling만으로는 해결할 수 없는 factuality, toxicity, helpfulness 문제를 다룰 수 있다.RL from AI Feedback은 모델의 self-critiques, revisions, output rankings를 사용해 이 과정을 부분적으로 자동화한다 (Bai et al., 2022b).
- 알려진 LLM 안전 과제: LLM safety research는 bias, toxicity, private-data leakage, malicious use, harmful-content attacks, emergent behaviors, cyber threats, 그리고 biological warfare에서의 misuse를 포함한 위험을 규명한다.이러한 위험은 base-system properties와 societal-context evaluations에 걸쳐 있으며, red-teaming 연구는 tuned 모델에 대한 공격이 성공했음을 기록한다.
7 결론
Llama 2는 7B–70B 규모의 사전학습 및 fine-tuning 모델군으로, 기존 open-source chat models와 경쟁하며 평가한 일부 항목에서는 proprietary models와 대등한 성능을 보이지만 GPT-4와 같은 모델에는 여전히 뒤처진다.
- 7 결론: Llama 2는 7 billion에서 70 billion parameters까지 아우르며 기존 open-source chat models와 경쟁력을 보인다. 평가한 evaluation set에서는 일부 proprietary models와 동등한 역량을 달성했지만 GPT-4에는 뒤처진다.또한 이 연구는 모델 개발에 사용한 방법과 기법을 상세히 설명하며, 특히 fine-tuning과 safety improvements에 중점을 둔다.
A 부록 · A.1 기여
부록 A.1은 저자들의 기여 구조를 기록하며, 성의 알파벳순 배열, 리더십 역할, 핵심 기여자, 기여자, 경영진 지원을 구분한다.
- A.1 기여: 모든 저자는 성을 기준으로 알파벳순으로 정렬되어 있다.
- A.1 기여: Science and Engineering Leadership에는 Guillem Cucurull, Naman Goyal, Louis Martin, Thomas Scialom, Ruan Silva, Kevin Stone, Hugo Touvron이 포함된다.
- A.1 기여: Technical and Management Leadership에는 Sergey Edunov, Angela Fan, Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic이 포함된다.
- A.1 기여: Core Contributors 그룹은 연구, 엔지니어링 및 관련 프로젝트 업무에 걸친 28명의 기여자로 구성된다.본문에는 Peter Albert, Nikolay Bashlykov, Prajjwal Bhargava, Moya Chen, David Esiobu, Jeremy Fu, Vedanuj Goswami, Anthony Hartshorn, Rui Hou, Marcin Kardas, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Diana Liskovich, Xavier Martinet, Yuning Mao, Igor Molybog, Todor Mihaylov, Andrew Poulton, Jeremy Reizenstein, Eric Michael Smith, Ranjan Subramanian, Xiaoqing Ellen Tan, Binh Tang, Ross Taylor, Jacob Xu, Yuchen Zhang, Iliyan Zarov가 열거되어 있다.
- A.1 기여: Contributors 그룹은 27명의 기여자로 구성된다.본문에는 Amjad Almahairi, Yasmine Babaei, Soumya Batra, Lukas Blecher, Dan Bikel, Shruti Bhosale, Cristian Canton Ferrer, Jude Fernandes, Wenyin Fu, Brian Fuller, Cynthia Gao, Saghar Hosseini, Hakan Inan, Isabel Kloumann, Madian Khabsa, Artem Korenev, Viktor Kerkez, Jian Xiang Kuan, Yinghai Lu, Jenya Lee, Pushkar Mishra, Yixin Nie, Rashi Rungta, Alan Schelten, Kalyan Saladi, Adina Williams, Zheng Yan이 열거되어 있다.
- A.1 기여: GenAI executive team에는 리더십과 지원에 대해 감사를 표하며, 구체적으로 Ahmad Al-Dahle와 Manohar Paluri가 언급된다.
A.2 사전학습 추가 세부사항 · A.2.1 Llama 1과 비교한 아키텍처 변경
Llama 2는 context window를 2,048에서 4,096 tokens로 확장하고, 긴 context 처리 능력과 inference 확장성을 높이기 위해 attention 대안을 평가한다. ablation과 scaling을 고려한 결과, 34B 및 70B 모델은 MQA 대신 GQA를 사용한다.
- A.2.1 Llama 1과 비교한 아키텍처 변경: Llama 2는 context window를 2,048에서 4,096 tokens로 확장해 더 긴 대화 기록, 요약, 문서 이해를 지원한다.이 연구는 long-context 및 general-task ablation에서 2k와 4k 사전학습을 비교하며, 두 모델 모두 동일한 설정에서 150B tokens로 학습한다.
- A.2.1 Llama 1과 비교한 아키텍처 변경: Grouped-query attention은 여러 head에 걸쳐 key와 value projection을 공유해 context window, batch size, model size가 증가할 때 KV-cache memory pressure를 줄인다.이는 대규모 multi-head attention 모델에서 병목이 되는 KV-cache 증가 문제를 해결하기 위한 것이다.
- A.2.1 Llama 1과 비교한 아키텍처 변경: attention ablation에서는 모든 variant가 150B training tokens와 fixed 30B model size를 사용하며, 감소한 attention parameter를 상쇄하기 위해 FFN dimension을 늘린다.FFN dimension은 MQA에서 1.33×, GQA에서 1.3× 증가하며, Table 18은 task-specific evaluation convention을 보고한다.
- A.2.1 Llama 1과 비교한 아키텍처 변경: eight A100 GPU와 tensor parallelism을 사용할 때 MQA는 head 간에 KV value를 shard할 수 없으며, 이를 복제하면 KV-cache size가 GQA와 같아진다.이 구현에서는 MQA와 GQA가 매우 유사하게 동작하며, MQA의 FFN dimension이 약간 더 크다.
- A.2.1 Llama 1과 비교한 아키텍처 변경: Multi-query variant는 더 큰 batch size에서 higher throughput을 제공하면서 작은 batch에서는 유사한 latency를 유지한다.보고된 설정에서 MHA는 256-token context의 batch size 1024와 2k context의 batch size 128에서 memory가 부족해 실행을 완료하지 못하는 반면, MQA와 GQA는 해당 실행을 완료한다.
- A.2.1 Llama 1과 비교한 아키텍처 변경: 34B 및 70B 모델에서 Llama 2는 ablation 결과와 더 쉬운 inference scaling을 바탕으로 MQA보다 GQA를 선택한다.이는 더 큰 모델에 대해 보고된 최종 아키텍처 선택이다.
A.2.2 사전학습 모델 평가 추가 세부 사항
이 절에서는 MMLU, 표준 벤치마크, 코드 생성, 세계 지식, 독해, 시험, 수학적 추론에 걸친 Llama 2의 평가를 자세히 다룬다. 독해에서 Llama 2는 보고된 모든 설정에서 가장 뛰어난 성능을 보이며, Llama 1 30B가 약간 더 나은 QUAC 0-shot은 예외다.
- MMLU: 평가에서는 Llama 2와 다른 오픈소스 모델의 MMLU 벤치마크 five-shot 성능을 보고한다.MMLU 평가 세부 사항은 Table 19에 제시한다.
- 표준 벤치마크: Llama 2는 여러 표준 벤치마크에서 평가되며, 결과는 Table 20에 제시한다.
- 코드 생성: 코드 생성 비교에서는 Human-Eval과 MBPP를 다루며, 각각 0-shot과 3-shot 결과를 보고한다.Pass@100과 pass@80에는 temperature 0.8과 top-p=0.95를 사용하고, pass@1에는 temperature 0.1과 top-p=0.95를 사용한다.
- 세계 지식: 세계 지식 평가는 NaturalQuestions와 TriviaQA에서 Llama 2를 다른 오픈소스 모델과 비교한다.Table 22에서는 필터링된 development set에서의 zero-shot 및 few-shot TriviaQA 결과를 포함해 exact-match 성능을 보고한다.
- 독해: Llama 2는 QUAC 0-shot을 제외한 모든 SQUAD 및 QUAC 평가 설정에서 가장 뛰어난 성능을 보이며, 해당 설정에서는 Llama 1 30B가 약간 더 나은 성능을 보인다.Table 23은 zero-shot 및 few-shot SQUAD 결과와 zero-shot 및 one-shot QUAC 결과를 보고한다.
- 시험 및 수학적 추론: 추가 평가에서는 English AGI Eval 시험과 GSM8k 및 MATH에 대한 수학적 추론을 다룬다.결과는 Tables 24 and 25에 제시하며, 수학적 추론 과제에는 maj1@1을 보고한다.
A.3 Fine-tuning 추가 세부사항 · A.3.1 Meta Human Preference Data의 상세 통계
Meta는 Safety 및 Helpfulness preference data의 14개 주간 batch에 걸쳐 1 million 건이 넘는 binary 비교를 수집했다. 시간이 지나면서 Llama 2-Chat 모델의 성능이 향상되어 annotation이 어려워짐에 따라 유사 응답에 대한 평가는 증가한 반면, 강한 선호는 감소했다.
- A.3.1 Meta Human Preference Data의 상세 통계: Meta Safety 및 Helpfulness preference data의 14개 주간 batch에 걸쳐 1 million 건이 넘는 binary model-generation 비교를 수집했다.상세한 batch 통계는 Table 26에 보고되어 있다.
- A.3.1 Meta Human Preference Data의 상세 통계: 추가 annotator가 합류하고 기존 annotator가 작업에 익숙해져 더 효율적으로 수행하면서, 후반 batch에는 더 많은 sample이 포함되었다.
- A.3.1 Meta Human Preference Data의 상세 통계: data collection은 Safety와 Helpfulness preference를 모두 다루는 14개 batch에 걸쳐 매주 수행되었다.
- A.3.1 Meta Human Preference Data의 상세 통계: collection 과정에서는 시간이 지남에 따라 multi-turn sample의 수를 의도적으로 늘렸다.
- A.3.1 Meta Human Preference Data의 상세 통계: batch가 진행될수록 유사 응답을 포함한 sample의 비율은 크게 증가한 반면, 더 강한 preference를 포함한 sample은 감소했다.Figure 25는 batch별 preference-rating 변화를 도시한다. 유사 응답에는 무시할 만큼 더 나은 경우와 판단이 불확실한 경우가 포함되며, 더 강한 preference에는 유의하게 더 나은 경우가 포함된다.
- A.3.1 Meta Human Preference Data의 상세 통계: 이러한 변화는 반복적인 model 업데이트와 annotation을 반영한다. 더 높은 성능의 Llama 2-Chat 모델을 response sampling에 사용하면서 preference를 구분하기가 더 어려워졌다.
A.3.2 Meta Human Preference Data를 위한 커리큘럼 전략
저자들은 alignment data를 위한 커리큘럼 주석 전략을 사용했다. 비교적 단순한 prompt에서 시작해 Llama 2-Chat에 점진적으로 더 복잡한 prompt와 새로운 skill을 도입하는 방식이다.
- A.3.2 Meta Human Preference Data를 위한 커리큘럼 전략: 커리큘럼 주석 전략은 비교적 단순한 prompt에서 시작해 Llama 2-Chat에 점진적으로 더 복잡한 prompt와 새로운 skill을 도입했다.이 전략은 fine-tuning 중 annotation platform과 긴밀히 협력해 개발됐으며, Figure 26은 helpfulness preference data에 이를 적용한 사례를 보여준다.
A.3.3 Reward Modeling을 위한 Preference Rating-based Margin을 적용한 Ranking Loss Ablation
이 ablation은 helpfulness reward model의 ranking loss에서 preference rating-based margin term을 margin이 없는 baseline과 비교해 평가한다. Margin은 더 잘 분리되는 response pair에서 accuracy를 높이지만 reward score를 더 극단적인 값으로 이동시켜 reward calibration의 필요성을 제기한다.
- Reward Modeling을 위한 Preference Rating-based Margin을 적용한 Ranking Loss Ablation: 이 ablation은 크기가 서로 다른 두 preference rating-based margin variant를 margin term이 없는 ranking loss와 비교한다.두 variant는 Table 27에 제시되며 Meta Helpful test set에서 평가된다.
- Reward Modeling을 위한 Preference Rating-based Margin을 적용한 Ranking Loss Ablation: Preference rating-based margin term은 margin term이 없는 baseline과 비교해 더 잘 분리되는 response pair에서 helpfulness reward-model accuracy를 향상시킨다.평가에서는 Meta Helpful test set에 대해 rating별 accuracy와 average accuracy를 모두 보고하며, 두 margin variant를 margin이 없는 baseline과 비교한다.
- Reward Modeling을 위한 Preference Rating-based Margin을 적용한 Ranking Loss Ablation: Margin은 reward score를 더 극단적인 값으로 이동시키며, 더 큰 margin일수록 더 큰 distribution shift를 유발해 PPO가 reward 변화에 민감해질 수 있다.관찰된 binary-split reward pattern은 향후 연구로 reward calibration을 시사한다. PPO와 같은 reinforcement-learning algorithm은 reward-distribution 변화에 민감할 수 있기 때문이다.
A.3.4 Ranking Loss와 Safety Auxiliary Loss를 적용한 Reward Modeling에 대한 Ablation … A.7 Model Card
appendix는 safety-aware reward modeling이 unsafe response recall과 category accuracy를 높이는 한편, GAtt가 20턴 동안 attribute reference를 보존한다고 보고한다. 또한 human-evaluation 절차, safety 분석, annotation 관행, dataset contamination 효과에 대한 제한적 근거를 상세히 설명한다.
- A.3.4 Ranking Loss와 Safety Auxiliary Loss를 적용한 Reward Modeling에 대한 Ablation: safety auxiliary loss는 reward threshold 0.5에서 unsafe response recall을 높이고 세 가지 safety category 전반의 accuracy를 향상시킨다.reward model이 safe generation과 unsafe generation을 구별하도록 학습하면 RLHF에 더 나은 safety reward signal을 제공한다.
- A.3.5 GAtt에 대한 Additional Results: 100% accuracy: GAtt는 정의된 attribute를 20턴 동안 보존하는 반면, GAtt가 없는 Llama 2-Chat은 turn t+3에서 10%로 떨어지고 그 이후에는 0%가 된다.평가에는 public figure와 hobby가 사용되었으며, 예시는 총 4048 token 미만이었다. 또한 GAtt는 unseen constraint와 Llama 1의 2048-token pretraining window를 넘어선 조건에도 일반화되었다.
- A.3.6 Model-Based Evaluation은 어디까지 가능한가?: Reward model은 helpfulness와 safety에 대한 human preference rating과 전반적으로 잘 calibration되어 있어, pairwise-ranking training을 거쳤음에도 point-wise metric으로 사용할 수 있음을 뒷받침한다.test set에는 triple review와 7-point Likert scale이 사용되었다.
- A.3.7 Human Evaluation: Human evaluation은 4000개가 넘는 다양한 prompt, 무작위화된 side-by-side judgment, pair당 세 명의 annotator를 사용해 Llama 2-Chat을 open-source 및 closed-source model과 비교한다.Open-source 비교에서는 1000-token context와 generation limit을 사용하고, closed-source 비교에서는 2000 token을 사용한다.
- A.4.1 Reward Modeling에서 Safety와 Helpfulness 간의 Tension; A.4.2 Safety Data Scaling에 대한 Qualitative Results; A.4.5 Safety Errors: False Refusals와 Vague Responses; A.4.6 Safety Evaluation Examples: Safety reward score와 helpfulness reward score는 충돌할 수 있으며, unsafe response가 높은 helpfulness score를 받고 safe response가 높은 safety score와 낮은 helpfulness score를 받을 수 있다.safety data를 늘리면 Llama 2-Chat은 더 안전해지며, safety data의 50%를 사용한 뒤에는 offensive content를 거부하는 경향도 나타난다.
- A.4.5 Safety Errors: False Refusals와 Vague Responses; A.4.6 Safety Evaluation Examples: Safety-data scaling은 false refusal을 증가시킨다. 그 비율은 helpfulness prompt에서 0.006%에서 0.05%까지, borderline prompt에서 15%에서 27%까지다.예시는 context distillation과 겉보기에는 benign한 prompt의 sensitive keyword로 인해 발생한 vague response와 false refusal을 기록한다.
- A.5 Data Annotation; A.5.1 SFT Annotation Instructions; A.5.2 Negative User Experience Categories; A.5.3 Quality Assurance Process; A.5.4 Annotator Selection; A.6 Dataset Contamination: appendix는 safety 중심의 annotation instruction, quality review, 다단계 annotator selection을 설명하며, contamination analysis에서는 주로 HellaSwag와 MMLU-Humanities에서 효과가 나타난다고 분석한다.70B model의 MMLU-Overall에서 보고된 clean-subset와 sampling-mean의 차이는 -0.9로 작다.