한 개발자가 1900년대 이전의 고전 텍스트만으로 3억 4천만 매개변수 규모의 LLM을 밑바닥부터 직접 학습시킨 과정을 공유합니다. 이 프로젝트는 기존의 정렬(alignment) 과정을 거치지 않아 시대적으로 부정확하거나 오늘날 기준에 맞지 않는 독특한 반응을 생성하며, 클라우드 GPU 약 8만 원의 비용만으로 모델을 완성한 점이 흥미롭습니다. 자체 구축한 데이터 파이프라인과 훈련 코드를 통해 대형 언어 모델의 작동 원리를 깊이 이해할 수 있는 훌륭한 오픈소스 사례입니다.
번역된 본문
원문 제목: 밑바닥부터 빅토리안 시대 LLM 만들기
출처: 해커뉴스(hackernews)
게시일: 2026년 5월 25일, 월요일 (소요 시간: 50분)
이 블로그 포스트에서는 오직 옛날 텍스트로만 학습시켜 (거의) 밑바닥부터 나만의 LLM을 만들었던 모험담을 공유하려고 합니다. 저만의 베이스 트레이닝 및 파인튜닝 스크립트, 데이터 처리 파이프라인, 그리고 커스텀 데이터셋을 직접 만들었습니다. ("거의 밑바닥부터"라는 말은 기존의 프로그래밍 언어와 라이브러리를 사용했다는 뜻입니다. AI를 "밑바닥부터" 만든다는 다른 모든 사람들과 마찬가지로, 어셈블리어까지는 작성하지 않았습니다...)
분명히 다른 사람들이 직접 만든 LLM에 대한 게시물들도 읽어봤지만, 아마 제가 직접 해볼 준비가 되어 있지 않았거나 그들이 작업 중인 모델이 그렇게 흥미롭지는 않았던 것 같습니다. 어쨌든, 나만의 빅토리아 시대 챗봇을 가지고 있다는 생각은... 진짜 존나 멋진 일이었습니다!!
그 이후로 예외 없이 매일 아플 때조차 제 나름의 '빈티지 LLM(Vintage LLM)' 작업을 했습니다. 그 사이에 Violet-1B4-Chat, Mr. Chatterbox, GPT-1900, Talkie, TypewriterLM-base와 같은 훨씬 더 많은 역사적 LLM들이 공개되었습니다.
무엇을, 왜, 어디서, 어떻게?
무엇을? 이것은 시간이 고정된(time-locked) LLM이자 역사적인 LLM으로, 영어만 지원하며 지식의 마감 연도는 1900년입니다. (특정 연도로 제한하는 것은 오류가 발생하기 쉽지만 최선을 다했습니다.) 이는 Llama 아키텍처를 기반으로 하며 3억 4천만(0.3B) 개의 매개변수(parameters)를 가지고 있습니다.
왜? 직접 해봐야만 배울 수 있기 때문이며, 이 프로젝트 자체가 엄청나게 재미있었기 때문입니다.
어디서, 어떻게? 저만의 데이터셋, 데이터 처리 및 훈련 코드를 직접 만들었습니다. 코드는 제가 보유한 LLM과 VS-Code, PI(OpenRouter 모델)를 활용해 일종의 '감에 의한 코딩(vibe-coded)' 방식으로 작성되었습니다. 저는 모든 단일 함수를 확인하고 검증했으며, 각 코드 파일이 정확히 어떤 역할을 하는지 깊이 이해하고 있습니다. 데이터셋 처리가 가장 많은 시간을 소요했고, 결국 작동하지 않는 온갖 방법을 시도하며 시간을 많이 낭비했습니다. 복잡한 해결책은 최악입니다... 모든 데이터는 제 개인 PC에서 처리했고, PC에서 더 작은 버전의 LLM을 훈련시켰습니다 (Cachy OS Linux, AMD Ryzen 7 9700X CPU, 64GB RAM, Radeon RX 9070 16GB VRAM). 3억 4천만 규모의 더 큰 모델의 경우 RunPod, ThunderCompute, Vast.ai에서 훈련시켰습니다. 제 PC에서 했다면 영원히 걸렸을 것입니다.
이 프로젝트의 총 비용은 GPU 비용만 약 80달러였습니다. 데이터를 처리할 괜찮은 PC가 있었기 때문입니다. RAM이 더 많았다면 특히 메모리 내 텍스트 중복 제거 작업에서 데이터를 훨씬 더 빨리 처리할 수 있었을 것입니다.
면책 조항: 이것은 장난감/취미용 LLM입니다 (하지만 매우 진지하게 다룹니다). 이 모델은 환각(hallucinate)을 일으킬 수 있으며, 당시에는 보통 정상적이라고 여겨졌지만 오늘날의 기준으로는 유해하고, 모욕적이며, 안전하지 않은 역사적인 콘텐츠를 반쯤 정확하게 생성해 낼 것입니다. 이는 예상된 일인데, 제가 어떠한 정렬(alignment) 작업도 하지 않았기 때문입니다. 모델을 정렬(또는 검열)하는 것은 상당한 노력이 필요하며 역사적 정확성을 망치게 됩니다. 또한, 저는 제 모델이 1900년으로 엄격하게 제한된다고 보장할 수 없습니다 (최선을 다했음에도 불구하고). 예를 들어 '알베르트 아인슈타인 테스트'를 수행하는 것과 같습니다.
계획
저는 매일 업무에서 AI를 사용하고 그 원리를 이해하고 있지만, 직접 LLM을 만들어 본 적은 없었습니다. 직장에서 특정 AI 훈련 및 파인튜닝 파이프라인을 실행해 봤고, 과거에 C와 Python으로 작은 신경망을 구축해 본 적은 있지만, 이 프로젝트를 시작할 때 사람들이 보통 LLM을 어떻게 구축하는지 몰랐습니다. 저는 일주일 동안 정보를 찾아봤고 다양한 관점을 얻기 위해 여러 봇들과 대화를 나눴습니다 (제가 항상 하는 방식처럼...).
Making a vintage LLM from scratch 2026 May 25, Mon 50 min In this blog post, I will share the adventures I had creating my own LLM, from (almost) scratch, trained only on old texts. I made my own base-training and fine-tuning scripts, data processing pipelines and custom datasets. ("almost from scratch" means I did use existing programming languages and libraries, I didn't write in Assembly, just like anyone else who builds an AI "from scratch"...) The model can be found on HuggingFace: https://huggingface.co/croqaz/vintage-LLM-340m-v1-base ; All the code is open source at: https://github.com/croqaz/vintage-LLM ; If you want to check bigger Vintage models, see my previous post: Vintage LLM models . The idea Three months ago at the end of February I discovered a few Reddit posts by Hayk Grigorian , where he described creating his temporal gated language model. I was absolutely fascinated. Training an LLM only on 1800s London texts, 90GB dataset: https://reddit.com/r/LocalLLaMA/comments/1pkpsee/training_an_llm_only_on_1800s_london_texts_90gb LLM trained from scratch on only 1800s London texts brings up a real protest from 1834: https://reddit.com/r/LocalLLaMA/comments/1mvnmjo/my_llm_trained_from_scratch_on_only_1800s_london Obviously I read other posts from other people that made their own LLMs, but maybe I wasn't ready to do it myself, or the model they were working on wasn't that interesting. Anyway, the thought of having my own Victorian chat bot... fuckin' epic !! Since then, I worked on my own "Vintage LLM" every single day. Without exceptions. Even when I was sick. In the meantime, a lot more historic LLMs have been released like: Violet-1B4-Chat , Mr. Chatterbox , GPT-1900 , Talkie and TypewriterLM-base . What, why, where and how? What? This is a time-locked LLM/ historical LLM, English only, and its knowledge cutoff is year 1900. (Limiting to a specific year is error prone, but I did my best effort). It is based on Llama architecture and has 340M (0.3B) params. Why? Because I can only learn if I do it myself and it's a super fun project. Where and how? I made my own dataset, my own processing and training code. The code is semi-vibe-coded with whatever LLM I had with VS-Code and PI (OpenRouter models). I checked and validated every single function and I deeply understand what every single code file is doing. The dataset processing took the most and I tried all sorts of things that didn't work, and I wasted a ton of time. Complicated solutions are the worst... I processed all the data on my own PC and I trained smaller versions of the LLM on my PC ( Cachy OS Linux, AMD Ryzen 7 9700X CPU, 64GB RAM, Radeon RX 9070 16GB VRAM ). As for the larger 340M model, I trained it on RunPod, ThunderCompute and Vast.ai . It would have taken forever on my PC. The total cost of this project was: ~$80, GPU costs only. That's because I have a decent PC to process the data. If I had more RAM, I could have processed some of the data much faster, especially when it comes to de-duplicating texts in memory. Disclaimer : This is a toy/ hobby LLM (but I treat it very seriously). It will hallucinate and generate historic semi-accurate content which, at the time was considered normal but by today's standards is considered: toxic, offensive and unsafe. This is expected, because I didn't do any alignment. Aligning (or censoring) the model requires significant effort and it would ruin the historic accuracy. Also, I can't guarantee that my model is strictly limited to the year 1900 (even if I did my best) eg: as to perform the "Albert Einstein test". The plan I use AI everyday at work and I understand how it works, but I never built an LLM myself. I ran specific AI training and fine-tuning pipelines at work, I built tiny neural networks in C and Python in the past, but when I started this project I didn't know how people are usually building LLMs. I searched for a week and I chatted with multiple bots to get different points of view (like I always do when I research a topic). In short, to build an LLM you need 4 things: the data -- an LLM has no discernment or understanding. It will learn from anything you tell it to, good or bad. This is the longest process. tokenization -- the Tokenizer is a little program that converts words or letters into numbers (tokens). LLMs don't understand words, they only understand numbers. pre-training -- it's a confusing expression and it means "base-training", where the LLM learns to autocomplete text. If you're going for a 300m+ params, this is the most expensive process. fine-tuning -- where the LLM learns how to chat in turns, question & answer. Well, there's a bit more to it than these simple steps, but I won't go super deep in this article. Now, let's look at each step in more detail. Initial experiments It's worth mentioning that I made lots of mistakes and I experimented with some datasets and model architectures before I settled on the "big" model. ("big" in quotes here, because you know, compared to larger models like Talkie-13B or TypewriterLM-7.24B, my model is just a toy) Some details about my v2 toy EleutherAI/pythia-14m that I trained on my own PC: https://github.com/croqaz/vintage-LLM/tree/e272b94fcf96316f874babbed549d20809fe5a39/models/m-v2 If you look at the validation loss and perplexity SVG files, you'll see huge jumps, because I didn't randomize the file chunks and the dataset files were tokenized in alphabetic order, and it happened that the clean book files were first and as soon as the model started to get exposed to the Time-Capsule dataset, it gradually become worse and worse because that dataset was bad with lots of weird OCR artefacts, broken words & sentences and so on. Mistakes were made ... but I learned from them. I was stuck for a while, until I started to filter out the bad documents. Data The data processing was the longest and most boring process by far, and I hope you understand why... There are plenty of modern, high quality datasets with data scraped from the internet, but I didn't want my LLM to learn about computers, atomic bombs and space-ships, so I had no choice but to make my own. Luckily there are some datasets available, but they are pretty bad quality and most of my work was to de-duplicate, filter the really bad texts and enhance some of the existing texts. The historic datasets are quite limited, the old books are all we have unless we discover more old books and someone scans them, so we have to use what we have. A few datasets worth mentioning are: Project Gutenberg, Oxford Text Archive, Internet Archive books, TheBritishLibrary/blbooks, storytracer/LoC-PD-Books, dell-research-harvard/AmericanStories, dell-research-harvard/NewsWire, Heritage Made Digital Newspapers (HMD). I did my best to find out the year and language of each dataset, so I can limit everything to English before year 1900. I completely ignored documents that don't specify a year, or I can't find date in the texts, even if they had good quality, just to be safe. As a side-project, I created the Book-Metadata HF dataset with lots of old books, title, author, book ID and source: https://huggingface.co/datasets/croqaz/book-metadata ; My goal was find out the year of all Gutenberg books, but I only found 5300 books where I'm 100% sure of the year. Again, this took absolutely forever and as I am writing this blog post, I'm still not completely finished. If I'll ever train another LLM, I'll have more and better data next time. Initially I wanted several de-duplication methods, including MinHash and embeddings vector similarity. If you don't know what it means, don't worry, I won't go into details. It was way too slow and expensive and I had to abandon it. Just to give you a taste of how slow this was, I had a beefy DEV server calculate embeddings for my short text datasets and I did 10% of the dataset in a week with the server running day & night. The server had a RTX 3090 GPU that I shared and so on. In the end, I de-duplicated base