[Paper Review] TinyLlama: An Open-Source Small Language Model

Peiyuan Zhang et.al., StarNLP
[Paper Review] TinyLlama: An Open-Source Small Language Model

👨🏽‍💻 Title & Authors (Affiliation)

  • TinyLlama: An Open-Source Small Language Model
  • Peiyuan Zhang, StarNLP
  • 24.01

✍🏼 한 줄 요약

  • 1.1B 사이즈의 LLM 소개

🔒 Problem

  • 비교적 큰 모델에 대량의 데이터로 학습한 연구 결과는 많으나 작은 모델에 큰 데이터로 학습한 실험 결과는 많지 않다.

🔑 Main Ideas

  • 1.1B Llama2를 3 Trillion tokens으로 학습
  • Pretraining Data
    • SlimPajama: RedPajama를 정제한 1.2T 데이터
    • Starcoderdata: 250 bilion tokens across 86 programming languages, 깃헙 이슈 데이터도 사용
    • 위 두개를 합쳐서 950B tokens을 만들고 3에폭 학습, NLP 데이터가 7, 코드가 3으로 비율 조정
  • 모델: Transformer Decoder 기반(LLama2와 유사)
    • Rotary Positional Embedding
    • RMSNorm
    • SwiGLU
    • Grouped-query Attention
  • Speed Optimization
    • Fully Shared Data Parallel
    • Flash Attention
    • xFormer: replaced the fused SwiGLU module from the xFormers repository with the original SwiGLU
    • Pythia, MPT에 비해 1.5~2배 빠른 학습

|Hidden Size|Intermediate Hidden Size|Context Len|Heads|Layers|Vocab Size| |:-:|:-:|:-:|:-:|:-:|:-:| |2048|5632|2048|16|22|32000|

  • 학습
    • lit-gpt로 구현 llama2 셋팅, Batch size as 2M tokens, 16*A100-40G GPU

📈 Results

  • Harness로 평가
    • image
    • image
    • hellaswag, piqa, arc 등 갑자기 점수가 뛰는 구간이 있는데, 실수로 eos토큰을 여러개 넣어서 학습 중인
  • Problem-soling evaluation: InstructEval Benchmark 사용
    • image

Limitations

  • 실제 Instruction Finetuning을 하고 대화를 해본 것에 대한 결과는 없음.

✏️ Conclusion

  • 작은 모델에도 데이터를 많이 넣으면 성능이 좋어지더라

❔ Questions

  • 한글 데이터만 있으면 Polyglot을 Further Pretraining 해도 성능이 올라갈까?
  • Instruction Finetuning 해본 결과
    • link
    • This is the chat model finetuned on top of TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T. We follow HF’s Zephyr’s training recipe. The model was “ initially fine-tuned on a variant of the UltraChat dataset, which contains a diverse range of synthetic dialogues generated by ChatGPT. We then further aligned the model with 🤗 TRL’s DPOTrainer on the openbmb/UltraFeedback dataset, which contain 64k prompts and model completions that are ranked by GPT-4.”