2024년 4월 19일
Llama 3
Llama 3. 공개된 것은 8B와 70B 모델입니다. 400B 모델이 학습 중이네요. 성능 수준을 보면 8B 모델은 7-8B 모델 중 최고 수준입니다. 70B 모델은 Claude 3 Sonnet++ 정도의 느낌이군요. 400B 모델은 GPT-4와 Claude 3 Opus 수준의 모델이 될 듯 합니다.
학습 데이터셋은 15T. 공개된 소스에서 수집했다는데 15T를 높은 퀄리티로 어떻게 확보할 수 있는지가 궁금하긴 하네요. 심지어 Multi Epoch가 아니고 Single Epoch입니다. (https://x.com/soumithchintala/status/1781095841349902392) 코드를 Llama 2에 비해 4배 더 넣었다고 하는데 Llama 2의 데이터 믹스를 모르니 알 수 없네요. Llama 1의 비율 4.5%를 사용하면 360B 정도가 되는데 아마 이보다 많이 넣으려고 하 않았을까 싶습니다.
128K 토크나이저를 사용하고 8B 모델에도 GQA를 사용했습니다. 8K Context Length. 128K 토크나이저는 잠깐 테스트해보면 한국어에 대해서는 Gemini의 260K 토크나이저보다 효율적인 것 같습니다. 다국어 성능과는 별개로 토크나이저에 대해서는 크게 신경 쓰지 않아도 될 듯하네요. 문서 경계를 넘지 않도록 Attention Mask를 적용한 부분을 특별히 언급하고 있는데 학습 효율성 때문에 잘 하지 않던 선택이지만 성능적으로는 이쪽이 낫다는 리포트도 나왔었죠. (https://arxiv.org/abs/2402.13991)
5%는 30개 언어에 대한 Multilingual. 30개 언어라는 것을 생각하면 좀 작지 않나 싶지만 그래도 750B 수준이고 0%였던 Llama 2에 대해서도 Multilingual 실험을 많이 했었다는 것을 생각해보면 훨씬 나은 상황이지 않을까 싶습니다.
데이터셋 필터링 과정에 대해 언급하고 있는데 휴리스틱, NSFW 필터는 일반적인 선택이고 Semantic Deduplication이라면 Fuzzy Deduplication을 넘어 임베딩을 사용했다는 의미인가 싶네요. 이미지에 대해서지만 Semantic Deduplication을 적용한 사례도 있습니다. (https://arxiv.org/abs/2303.09540) 퀄리티 분류기는 Llama 2를 사용해서 만들었다고 하는데 아마도 Llama 2로 높은 퀄리티의 문서를 선택한 것일 듯 하네요. LLM으로 필터링하는 접근은 최근에 하나 나왔었죠. (https://arxiv.org/abs/2402.09668)
데이터 믹스에 대해 실험을 많이 했고 Scaling Law를 사용했다고 하는데 Downstream Task에 대한 성능과 데이터 믹스를 예측하기 위한 Scaling Law들에 대한 결과도 최근 나오고 있습니다. (https://arxiv.org/abs/2403.08540, https://arxiv.org/abs/2403.16952) 15T 학습 이후에도 여전히 성능 향상이 나타나고 있다고.
최근 언급했던 24K H100 클러스터에서 학습했고 400 TFLOPS 달성했습니다. H100에서 40% MFU라고 하면 상당히 좋은 수치일 것 같네요.
정렬에는 사람이 구축한 10M 규모의 데이터를 사용. Llama 2에서 이미 1M이 넘었으니 자연스러운 규모 증가인 듯 합니다
Multimodal이나 Multilingual, Long Context는 추후 추가될 예정이라고 합니다. Multimodal이 혹시 같이 나올 수도 있지 않을까 했는데 역시 일정이 만만하지는 않은 듯 하네요.
이제 모두에게 필요했던 바로 그 모델이 나온 듯 합니다. 다만 Llama 3를 쓰면 Built with Meta Llama 3라고 기술해야 하고 Llama 3로 모델을 만들었다면 Llama 3를 모델 이름에 붙여야 한다고 합니다. 그러나 70B 모델을 15T 학습시킬 수 있는 것이 아니라면 그걸 붙이는 것을 선택하는 사람들이 많이 있겠죠.
때맞춰 Dwarkesh Patel 팟캐스트에 Mark Zuckerberg 인터뷰가 올라왔군요.
#llm
From r to Q∗: Your Language Model is Secretly a Q-Function
(Rafael Rafailov, Joey Hejna, Ryan Park, Chelsea Finn)
Reinforcement Learning From Human Feedback (RLHF) has been a critical to the success of the latest generation of generative AI models. In response to the complex nature of the classical RLHF pipeline, direct alignment algorithms such as Direct Preference Optimization (DPO) have emerged as an alternative approach. Although DPO solves the same objective as the standard RLHF setup, there is a mismatch between the two approaches. Standard RLHF deploys reinforcement learning in a specific token-level MDP, while DPO is derived as a bandit problem in which the whole response of the model is treated as a single arm. In this work we rectify this difference, first we theoretically show that we can derive DPO in the token-level MDP as a general inverse Q-learning algorithm, which satisfies the Bellman equation. Using our theoretical results, we provide three concrete empirical insights. First, we show that because of its token level interpretation, DPO is able to perform some type of credit assignment. Next, we prove that under the token level formulation, classical search-based algorithms, such as MCTS, which have recently been applied to the language generation space, are equivalent to likelihood-based search on a DPO policy. Empirically we show that a simple beam search yields meaningful improvement over the base DPO policy. Finally, we show how the choice of reference policy causes implicit rewards to decline during training. We conclude by discussing applications of our work, including information elicitation in multi-tun dialogue, reasoning, agentic applications and end-to-end training of multi-model systems.
MDP vs Contextual Bandit 문제가 DPO까지 넘어왔군요. 토큰 레벨 Reward r이 Q* 와 대응된다는 것을 기반으로 해서 토큰 레벨 DPO를 유도했습니다.
이를 기반으로 몇 가지 재미있는 결과들을 만들었네요. 시퀀스 단위 Reward로 학습시켰을 때 각 토큰에 대해 Credit Assignment를 할 수 있다는 것과 디코딩 시 토큰 단위의 서치 과정에서 학습된 Policy를 사용할 수 있다는 것을 보였습니다. 재미있네요.
#rlhf