---
type: "post"
id: "lyra-a-326m-parameter-decoder-only-transformer-trained-a31379"
slug: "lyra-a-326m-parameter-decoder-only-transformer-trained-a31379"
title: "Lyra: A 326M-parameter decoder-only Transformer trained from scratch on 6.4B tokens using a single RTX 3060 Ti"
description: "Lyra is a 326M-parameter decoder-only Transformer trained from scratch, with pretraining on 6.4B tokens using a single NVIDIA RTX 3060 Ti with 8 GB of VRAM."
retrieval_nugget: "Lyra is a 326M-parameter decoder-only Transformer trained from scratch, with pretraining on 6.4B tokens using a single NVIDIA RTX 3060 Ti with 8 GB of VRAM. Its repository includes data streaming, pretraining, supervised fine-tuning and a terminal chat interface, making the project a hands-on pipeline rather than weights alone. (github.com)"
published_at: "2026-12-03"
updated_at: "2026-12-03"
record_date: "2026-12-03"
date_kind: "published_at"
topics: []
entities: ["Lyra","Luka","NVIDIA GeForce RTX 3060 Ti"]
related_patterns: []
novelty_label: "new_fact"
what_changed: "A 14-year-old in Serbia trained Lyra, a 326-million-parameter language model, from scratch on 6.4 billion tokens using one RTX 3060 Ti."
prior_refs: []
source_url: "https://github.com/luka0x12/Lyra"
source_urls: ["https://github.com/luka0x12/Lyra"]
production: {"schema":"newruntime-production-v1","desk":"newsroom","first_seen_at":"2026-12-03T14:00:34.076Z","independent_sources":1,"notes_synthesized":null,"writer_model":"gpt-6-luna","critic":null,"checks":["primary_source_verified","source_fresh","one_story","copy_contract"],"novelty":{"label":"new_fact","confidence":"high"},"editorial_value":"medium","human_review":"selective"}
citations: [{"claim":"","quotes":["GitHub - luka0x12/Lyra: A 326M-parameter decoder-only Transformer trained from scratch on 6.4B tokens using a single RTX 3060 Ti.","GitHub - luka0x12/Lyra: A 326M-parameter decoder-only Transformer trained from scratch on 6.4B tokens using a single RTX 3060 Ti. Includes the full pretraining, SFT, and inference pipeline.","This repository contains the complete pipeline: data streaming, pretraining, supervised fine-tuning (SFT), and the custom terminal chat interface."],"cite_url":"https://github.com/luka0x12/Lyra#:~:text=GitHub%20%2D%20luka0x12%2FLyra%3A%20A%20326M%2Dparameter%20decoder%2Donly%20Transformer%20trained%20from%20scratch%20on%206.4B%20tokens%20using%20a%20single%20RTX%203060%20Ti.&text=GitHub%20%2D%20luka0x12%2FLyra%3A%20A%20326M%2Dparameter%20decoder%2Donly%20Transformer%20trained%20from%20scratch%20on%206.4B%20tokens%20using%20a%20single%20RTX%203060%20Ti.%20Includes%20the%20full%20pretraining%2C%20SFT%2C%20and%20inference%20pipeline.&text=This%20repository%20contains%20the%20complete%20pipeline%3A%20data%20streaming%2C%20pretraining%2C%20supervised%20fine%2Dtuning%20%28SFT%29%2C%20and%20the%20custom%20terminal%20chat%20interface.","source_url":"https://github.com/luka0x12/Lyra","publisher":"github.com"},{"claim":"","quotes":["Model Weights: Base Model: luka0x12/Lyra-326M-base Instruct Model: luka0x12/Lyra-326M-Instruct The Build Pretraining (PTL-1): 195,312 steps on a mixture of FineWeb-Edu (70%), Cosmopedia v2 (20%), and Python-Edu (10%).","SFT (Second Voice): ~78k examples using length-bucketed batches and assistant-only loss masking."],"cite_url":"https://github.com/luka0x12/Lyra#:~:text=Model%20Weights%3A%20Base%20Model%3A%20luka0x12%2FLyra%2D326M%2Dbase%20Instruct%20Model%3A%20luka0x12%2FLyra%2D326M%2DInstruct%20The%20Build%20Pretraining%20%28PTL%2D1%29%3A%20195%2C312%20steps%20on%20a%20mixture%20of%20FineWeb%2DEdu%20%2870%25%29%2C%20Cosmopedia%20v2%20%2820%25%29%2C%20and%20Python%2DEdu%20%2810%25%29.&text=SFT%20%28Second%20Voice%29%3A%20%7E78k%20examples%20using%20length%2Dbucketed%20batches%20and%20assistant%2Donly%20loss%20masking.","source_url":"https://github.com/luka0x12/Lyra","publisher":"github.com"},{"claim":"","quotes":["The docs/architecture.md file contains a detailed ledger of the 9 major bugs encountered during this project, including: The 8x Loss Illusion: The dashboard displayed a loss of 35.2 because the GPU accumulator summed micro-steps but the readout only divided by optimizer steps.","Restarting with --resume loaded a checkpoint from 20,000 steps ago, silently throwing away 10 hours of compute. Fixed by introducing a separate last.pt progress tracker.","The SFT mixture includes DailyDialog (CC BY-NC-SA 4.0) and non-commercial subsets of Tulu-3, so the final weights cannot be used for commercial products."],"cite_url":"https://github.com/luka0x12/Lyra#:~:text=The%20docs%2Farchitecture.md%20file%20contains%20a%20detailed%20ledger%20of%20the%209%20major%20bugs%20encountered%20during%20this%20project%2C%20including%3A%20The%208x%20Loss%20Illusion%3A%20The%20dashboard%20displayed%20a%20loss%20of%2035.2%20because%20the%20GPU%20accumulator%20summed%20micro%2Dsteps%20but%20the%20readout%20only%20divided%20by%20optimizer%20steps.&text=Restarting%20with%20%2D%2Dresume%20loaded%20a%20checkpoint%20from%2020%2C000%20steps%20ago%2C%20silently%20throwing%20away%2010%20hours%20of%20compute.%20Fixed%20by%20introducing%20a%20separate%20last.pt%20progress%20tracker.&text=The%20SFT%20mixture%20includes%20DailyDialog%20%28CC%20BY%2DNC%2DSA%204.0%29%20and%20non%2Dcommercial%20subsets%20of%20Tulu%2D3%2C%20so%20the%20final%20weights%20cannot%20be%20used%20for%20commercial%20products.","source_url":"https://github.com/luka0x12/Lyra","publisher":"github.com"},{"claim":"","quotes":["Reached a validation loss of 2.32 nats (perplexity 10.19).","Hardware: One RTX 3060 Ti, 32 GB system RAM.","Total wall-clock time: ~180 hours."],"cite_url":"https://github.com/luka0x12/Lyra#:~:text=Reached%20a%20validation%20loss%20of%202.32%20nats%20%28perplexity%2010.19%29.&text=Hardware%3A%20One%20RTX%203060%20Ti%2C%2032%20GB%20system%20RAM.&text=Total%20wall%2Dclock%20time%3A%20%7E180%20hours.","source_url":"https://github.com/luka0x12/Lyra","publisher":"github.com"},{"claim":"","quotes":["Model Weights: Base Model: luka0x12/Lyra-326M-base Instruct Model: luka0x12/Lyra-326M-Instruct The Build Pretraining (PTL-1): 195,312 steps on a mixture of FineWeb-Edu (70%), Cosmopedia v2 (20%), and Python-Edu (10%).","Download the instruct weights from Hugging Face and run the chat interface.","License Code: Apache-2.0.","The SFT mixture includes DailyDialog (CC BY-NC-SA 4.0) and non-commercial subsets of Tulu-3, so the final weights cannot be used for commercial products.","Custom SFT Data ( lyra_sft.jsonl ): CC0 (Public Domain)."],"cite_url":"https://github.com/luka0x12/Lyra#:~:text=Model%20Weights%3A%20Base%20Model%3A%20luka0x12%2FLyra%2D326M%2Dbase%20Instruct%20Model%3A%20luka0x12%2FLyra%2D326M%2DInstruct%20The%20Build%20Pretraining%20%28PTL%2D1%29%3A%20195%2C312%20steps%20on%20a%20mixture%20of%20FineWeb%2DEdu%20%2870%25%29%2C%20Cosmopedia%20v2%20%2820%25%29%2C%20and%20Python%2DEdu%20%2810%25%29.&text=Download%20the%20instruct%20weights%20from%20Hugging%20Face%20and%20run%20the%20chat%20interface.&text=License%20Code%3A%20Apache%2D2.0.&text=The%20SFT%20mixture%20includes%20DailyDialog%20%28CC%20BY%2DNC%2DSA%204.0%29%20and%20non%2Dcommercial%20subsets%20of%20Tulu%2D3%2C%20so%20the%20final%20weights%20cannot%20be%20used%20for%20commercial%20products.&text=Custom%20SFT%20Data%20%28%20lyra_sft.jsonl%20%29%3A%20CC0%20%28Public%20Domain%29.","source_url":"https://github.com/luka0x12/Lyra","publisher":"github.com"},{"claim":"","quotes":["Reached a validation loss of 2.32 nats (perplexity 10.19).","Total wall-clock time: ~180 hours."],"cite_url":"https://github.com/luka0x12/Lyra#:~:text=Reached%20a%20validation%20loss%20of%202.32%20nats%20%28perplexity%2010.19%29.&text=Total%20wall%2Dclock%20time%3A%20%7E180%20hours.","source_url":"https://github.com/luka0x12/Lyra","publisher":"github.com"},{"claim":"sh git clone https://huggingface.co/luka0x12/Lyra-326M-Instruct cd Lyra-326M-Instruct pip install torch sentencepiece safetensors numpy python chat.py","quotes":["Clone the repository git clone … every edge case in PyTorch."],"cite_url":"https://github.com/luka0x12/Lyra#:~:text=Clone%20the%20repository%20git%20clone,every%20edge%20case%20in%20PyTorch.","source_url":"https://github.com/luka0x12/Lyra","publisher":"github.com"}]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:lyra-a-326m-parameter-decoder-only-transformer-trained-a31379"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/lyra-a-326m-parameter-decoder-only-transformer-trained-a31379/","markdown":"https://newruntime.com/posts/lyra-a-326m-parameter-decoder-only-transformer-trained-a31379.md","json":"https://newruntime.com/posts/lyra-a-326m-parameter-decoder-only-transformer-trained-a31379.json"}
markdown_url: "https://newruntime.com/posts/lyra-a-326m-parameter-decoder-only-transformer-trained-a31379.md"
---

# Lyra: A 326M-parameter decoder-only Transformer trained from scratch on 6.4B tokens using a single RTX 3060 Ti

## Retrieval answer

Lyra is a 326M-parameter decoder-only Transformer trained from scratch, with pretraining on 6.4B tokens using a single NVIDIA RTX 3060 Ti with 8 GB of VRAM. Its repository includes data streaming, pretraining, supervised fine-tuning and a terminal chat interface, making the project a hands-on pipeline rather than weights alone. (github.com)

## Summary

Lyra is a 326M-parameter decoder-only Transformer trained from scratch, with pretraining on 6.4B tokens using a single NVIDIA RTX 3060 Ti with 8 GB of VRAM. Its repository includes data streaming, pretraining, supervised fine-tuning and a terminal chat interface, making the project a hands-on pipeline rather than weights alone. ([github.com](https://github.com/luka0x12/Lyra#:~:text=GitHub%20%2D%20luka0x12%2FLyra%3A%20A%20326M%2Dparameter%20decoder%2Donly%20Transformer%20trained%20from%20scratch%20on%206.4B%20tokens%20using%20a%20single%20RTX%203060%20Ti.&text=GitHub%20%2D%20luka0x12%2FLyra%3A%20A%20326M%2Dparameter%20decoder%2Donly%20Transformer%20trained%20from%20scratch%20on%206.4B%20tokens%20using%20a%20single%20RTX%203060%20Ti.%20Includes%20the%20full%20pretraining%2C%20SFT%2C%20and%20inference%20pipeline.&text=This%20repository%20contains%20the%20complete%20pipeline%3A%20data%20streaming%2C%20pretraining%2C%20supervised%20fine%2Dtuning%20%28SFT%29%2C%20and%20the%20custom%20terminal%20chat%20interface.))

## What happened

The author says the model was trained by a 14-year-old in Serbia. Pretraining ran for 195,312 steps on a mixture of FineWeb-Edu (70%), Cosmopedia v2 (20%) and Python-Edu (10%); supervised fine-tuning used about 78,000 examples, with length-bucketed batches and assistant-only loss masking. The architecture uses RMSNorm, SwiGLU, QK-norm and residual scaling. ([github.com](https://github.com/luka0x12/Lyra#:~:text=Model%20Weights%3A%20Base%20Model%3A%20luka0x12%2FLyra%2D326M%2Dbase%20Instruct%20Model%3A%20luka0x12%2FLyra%2D326M%2DInstruct%20The%20Build%20Pretraining%20%28PTL%2D1%29%3A%20195%2C312%20steps%20on%20a%20mixture%20of%20FineWeb%2DEdu%20%2870%25%29%2C%20Cosmopedia%20v2%20%2820%25%29%2C%20and%20Python%2DEdu%20%2810%25%29.&text=SFT%20%28Second%20Voice%29%3A%20%7E78k%20examples%20using%20length%2Dbucketed%20batches%20and%20assistant%2Donly%20loss%20masking.))

The project documents nine major bugs, including a dashboard readout that showed a loss of 35.2 because its GPU accumulator summed micro-steps while the display divided by optimizer steps. Another resume bug loaded a checkpoint 20,000 steps behind, discarding 10 hours of compute; the author added a separate `last.pt` progress tracker. The fine-tuning mixture also includes DailyDialog and non-commercial subsets of Tulu-3. ([github.com](https://github.com/luka0x12/Lyra#:~:text=The%20docs%2Farchitecture.md%20file%20contains%20a%20detailed%20ledger%20of%20the%209%20major%20bugs%20encountered%20during%20this%20project%2C%20including%3A%20The%208x%20Loss%20Illusion%3A%20The%20dashboard%20displayed%20a%20loss%20of%2035.2%20because%20the%20GPU%20accumulator%20summed%20micro%2Dsteps%20but%20the%20readout%20only%20divided%20by%20optimizer%20steps.&text=Restarting%20with%20%2D%2Dresume%20loaded%20a%20checkpoint%20from%2020%2C000%20steps%20ago%2C%20silently%20throwing%20away%2010%20hours%20of%20compute.%20Fixed%20by%20introducing%20a%20separate%20last.pt%20progress%20tracker.&text=The%20SFT%20mixture%20includes%20DailyDialog%20%28CC%20BY%2DNC%2DSA%204.0%29%20and%20non%2Dcommercial%20subsets%20of%20Tulu%2D3%2C%20so%20the%20final%20weights%20cannot%20be%20used%20for%20commercial%20products.))

The author reports validation loss of 2.32 nats and perplexity of 10.19. The machine had 32 GB of system RAM; reported pretraining throughput was about 10,000 tokens per second, with roughly 180 hours of wall-clock time and 57 kWh of energy use. ([github.com](https://github.com/luka0x12/Lyra#:~:text=Reached%20a%20validation%20loss%20of%202.32%20nats%20%28perplexity%2010.19%29.&text=Hardware%3A%20One%20RTX%203060%20Ti%2C%2032%20GB%20system%20RAM.&text=Total%20wall%2Dclock%20time%3A%20%7E180%20hours.))

Base and instruct weights are listed on Hugging Face as `luka0x12/Lyra-326M-base` and `luka0x12/Lyra-326M-Instruct`; users can download the instruct weights and run the terminal chat interface without training the model. The code is Apache-2.0, while the weights are CC-BY-NC-4.0 and the repository says they cannot be used in commercial products. The custom 1,000-example persona and identity dataset is offered under CC0. ([github.com](https://github.com/luka0x12/Lyra#:~:text=Model%20Weights%3A%20Base%20Model%3A%20luka0x12%2FLyra%2D326M%2Dbase%20Instruct%20Model%3A%20luka0x12%2FLyra%2D326M%2DInstruct%20The%20Build%20Pretraining%20%28PTL%2D1%29%3A%20195%2C312%20steps%20on%20a%20mixture%20of%20FineWeb%2DEdu%20%2870%25%29%2C%20Cosmopedia%20v2%20%2820%25%29%2C%20and%20Python%2DEdu%20%2810%25%29.&text=Download%20the%20instruct%20weights%20from%20Hugging%20Face%20and%20run%20the%20chat%20interface.&text=License%20Code%3A%20Apache%2D2.0.&text=The%20SFT%20mixture%20includes%20DailyDialog%20%28CC%20BY%2DNC%2DSA%204.0%29%20and%20non%2Dcommercial%20subsets%20of%20Tulu%2D3%2C%20so%20the%20final%20weights%20cannot%20be%20used%20for%20commercial%20products.&text=Custom%20SFT%20Data%20%28%20lyra_sft.jsonl%20%29%3A%20CC0%20%28Public%20Domain%29.))

## What the archive adds

Lyra belongs alongside hands-on resources for learning language-model training: its value is the documented process and debugging trail, not a claim to be a successor to earlier projects.

## Why it matters

For builders, the pipeline and failure ledger make Lyra useful as a study project; the non-commercial weights license draws a clear boundary between learning from the release and shipping its final model in a commercial product.

## Limits and uncertainty

The author reports the validation metrics, throughput, time and energy figures; they are not independent benchmark results, and no independent comparison is provided. ([github.com](https://github.com/luka0x12/Lyra#:~:text=Reached%20a%20validation%20loss%20of%202.32%20nats%20%28perplexity%2010.19%29.&text=Total%20wall%2Dclock%20time%3A%20%7E180%20hours.))

## Skill to build now

```sh
git clone https://huggingface.co/luka0x12/Lyra-326M-Instruct
cd Lyra-326M-Instruct
pip install torch sentencepiece safetensors numpy
python chat.py
``` ([github.com](https://github.com/luka0x12/Lyra#:~:text=Clone%20the%20repository%20git%20clone,every%20edge%20case%20in%20PyTorch.))

## Reader takeaway

Lyra-326M’s practical value is the end-to-end learning artifact: data streaming, pretraining, fine-tuning and a chat interface built around a small model trained on consumer hardware. The author reports the training details and metrics, but the weights are CC-BY-NC-4.0 and explicitly barred from commercial products; the code and custom data have separate licenses.

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Sources](https://newruntime.com/sources/): See the original sources this archive cites.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
