
phi
Language1,366 ops1.4B params
A small decoder-only Transformer language model from the Phi series, trained on textbook-quality data.
Language · 1,366 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
This model is phi-1, the code model that opened the series. Its paper obtains it by fine-tuning a base model, phi-1-base, on a dataset of synthetic coding exercises.
About this model's family
The Phi models are a series of small Transformer language models from the Machine Learning Foundations team at Microsoft Research. Their shared premise is that the quality of the training data plays a critical role, so the data is selected or generated to read like a textbook. The first, phi-1, is a model for code that its paper describes as having 1.3B parameters and being trained for 4 days on 8 A100s. The paper reports pass at 1 accuracy of 50.6% on HumanEval and 55.5% on MBPP.
Architecturally, phi-1 is a decoder-only Transformer in which the attention and MLP layers run in parallel, following models such as CodeGen. It has 24 layers, a hidden dimension of 2048 and 32 attention heads of dimension 64. The next model, phi-1.5, keeps exactly the same architecture as phi-1. What changes is the data: roughly 20B tokens of newly generated textbook-like text meant to teach common sense reasoning and general knowledge.
Phi-2 is larger; its card describes a Transformer with 2.7 billion parameters, trained on the data sources of Phi-1.5 plus synthetic NLP texts and filtered websites. Its announcement says training covered 1.4T tokens and took 14 days on 96 A100 GPUs. Phi-2 is a base model: the announcement notes that it has not been aligned through reinforcement learning from human feedback and has not been instruct fine-tuned.
Key idea. The phi-1 paper showed that a 1.3B-parameter Transformer trained on filtered and synthetically generated textbook-quality data reaches 50.6% pass at 1 accuracy on HumanEval.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{gunasekar2023textbooksneed,
title={Textbooks Are All You Need},
author={Suriya Gunasekar and Yi Zhang and Jyoti Aneja and Caio César Teodoro Mendes and Allie Del Giorno and Sivakanth Gopi and Mojan Javaheripi and Piero Kauffmann and Gustavo de Rosa and Olli Saarikivi and Adil Salim and Shital Shah and Harkirat Singh Behl and Xin Wang and Sébastien Bubeck and Ronen Eldan and Adam Tauman Kalai and Yin Tat Lee and Yuanzhi Li},
year={2023},
eprint={2306.11644},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2306.11644},
}