Skip to content

Techniques

Every non-trivial technique used in Lavender-2 v0.1.0, with a pointer to the paper that introduced it and the reference implementation the code mirrors. If a future agent wants to change one of these, they should read the primary source first.

All links below are to public artifacts. Paper links point to arXiv where available.


Tokenizer

Byte-Pair Encoding with a byte-level pre-tokenizer


Architecture

Decoder-only Transformer

RMSNorm (pre-norm)

Rotary Position Embeddings (RoPE)

Grouped-Query Attention (GQA)

KV cache (inference)

  • What: Cache K and V per layer across autoregressive steps so each new token costs one forward pass at the new timestep only.
  • Standard autoregressive-decoding trick; first appears as a practical optimization in OpenAI / Google codebases rather than a named paper. The HuggingFace documentation has a clean writeup: https://huggingface.co/docs/transformers/main/kv_cache.

SwiGLU feed-forward

Mixture of Experts with top-k routing


Training

AdamW optimizer

Cosine-annealing learning rate

  • Paper: Loshchilov & Hutter, SGDR: Stochastic Gradient Descent with Warm Restarts, ICLR 2017. https://arxiv.org/abs/1608.03983
  • Reference code: torch.optim.lr_scheduler.CosineAnnealingLR.

bfloat16 mixed-precision training (AMP)

  • What: Forward + loss in bf16 via torch.autocast; optimizer state stays in fp32; GradScaler stabilizes the backward pass when any fp16 op is still in play.
  • Paper (bf16 rationale): Kalamkar et al., A Study of BFLOAT16 for Deep Learning Training, 2019. https://arxiv.org/abs/1905.12322
  • AMP recipe paper: Micikevicius et al., Mixed Precision Training, ICLR 2018. https://arxiv.org/abs/1710.03740
  • Reference code: torch.amp.autocast, torch.amp.GradScaler.

Distributed sharding (FSDP / DeepSpeed ZeRO-3)

Target runtime for the 70B config; not exercised by the dev config.


Datasets (v0.1.0 mix)

Every dataset in the registry, with its source and citation. Access rules differ: gated datasets require a HuggingFace token and manual terms acceptance.

KeyHF pathPaper / sourceAccess
wildchatallenai/WildChat-1MZhao et al., WildChat: 1M ChatGPT Interaction Logs in the Wild, ICLR 2024. https://arxiv.org/abs/2405.01470open
sodaallenai/sodaKim et al., SODA: Million-scale Dialogue Distillation with Social Commonsense Contextualization, EMNLP 2023. https://arxiv.org/abs/2212.10465open
dailydialogroskoN/dailydialog (parquet mirror)Li et al., DailyDialog: A Manually Labelled Multi-turn Dialogue Dataset, IJCNLP 2017. https://arxiv.org/abs/1710.03957open
topical_chatagentlans/Conversational-Reasoning-Topical-ChatGopalakrishnan et al., Topical-Chat: Towards Knowledge-Grounded Open-Domain Conversations, Interspeech 2019. https://www.isca-archive.org/interspeech_2019/gopalakrishnan19_interspeech.htmlopen
multiwozpfb30/multi_woz_v22Zang et al., MultiWOZ 2.2: A Dialogue Dataset with Additional Annotation Corrections and State Tracking Baselines, NLP4ConvAI 2020. https://arxiv.org/abs/2007.12720open
taskmastergoogle-research-datasets/taskmaster2Byrne et al., Taskmaster-1: Toward a Realistic and Diverse Dialog Dataset, EMNLP 2019. https://arxiv.org/abs/1909.05358 (v2 is the dataset shipped). https://github.com/google-research-datasets/Taskmasteropen
wikipediawikimedia/wikipedia (20231101.en)Wikimedia Foundation, plain-text English Wikipedia dump. https://dumps.wikimedia.org/open
lmsys_chatlmsys/lmsys-chat-1mZheng et al., LMSYS-Chat-1M: A Large-Scale Real-World LLM Conversation Dataset, ICLR 2024. https://arxiv.org/abs/2309.11998gated
arenalmsys/chatbot_arena_conversationsZheng et al., Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena, NeurIPS 2023. https://arxiv.org/abs/2306.05685gated
claude_opusRoman1111111/claude-opus-4.6-10000xCommunity distillation set of Claude Opus 4.6 reasoning traces (math & logic); no formal paper.open
kimi_k25ianncity/KIMI-K2.5-700000xCommunity distillation set of Moonshot AI's Kimi K2.5 reasoning traces; no formal paper.open
opus_reasoningnohurry/Opus-4.6-Reasoning-3000x-filteredFiltered community distillation of Claude Opus 4.6 reasoning with thinking traces; no formal paper.open

Dataset weights (per-dataset weight in the notebook registry) determine the mixture proportions at pretrain time. See the registry in full_llm_pipeline.ipynb (search for "wildchat").


Notes on provenance

The "Reference code" links above point to the implementation the Lavender-2 notebook code most closely mirrors. Where Meta's Llama repository is listed, the specific functions referenced (RMSNorm, apply_rotary_emb, FeedForward, attention block) are the canonical readable implementations — the notebook code is written independently in plain PyTorch rather than copied, but the shape and variable names track Llama conventions deliberately so a reader coming from that codebase doesn't have to retranslate.