메뉴
HN
Hacker News • 5일 전

미니 AGI – 8GB VRAM으로 학습하는 지속학습 언어모델

IMP
6/10
핵심 요약

해커뉴스에 'mini-AGI'라는 프로젝트가 공개됐다. 8GB VRAM 소비자용 GPU 한 장으로 처음부터 학습 가능하며, 읽는 모든 것에서 계속 학습하는 바이트 단위 언어모델이다. 가중치를 디스크에 저장하고 필요할 때만 VRAM으로 불러오는 방식으로 파라미터 수를 디스크 용량만큼 확장할 수 있고, 치명적 망각 없는 단일 데이터 스트림 지속학습이 보통 하드웨어에서도 가능함을 보여준다는 점이 핵심이다.

번역된 본문

mini-AGI는 스스로 아키텍처를 조립하고, 단일 8GB VRAM GPU에서 처음부터 학습하며, 읽는 모든 것에서 계속 학습하는 지속학습 바이트 단위 언어모델이다. 가중치를 디스크의 일반 파일로 저장하고 필요할 때 GPU로 페이징하기 때문에, 파라미터 수는 VRAM이 아닌 여유 디스크 공간에 의해 결정된다. 학습 중 용량이 부족하면 새로운 용량을 늘리고, 사용되지 않는 부분은 가지치기(prune)하며, 서빙에 사용되는 것과 정확히 동일한 코드 경로로 읽기를 수행한다. 보드에 8GB VRAM GPU 이상을 장착한 PC나 노트북을 대상으로 한다.

참고: 현재 이것은 작은 토이 수준의 모델이다. 최첨단(frontier) 수준의 능력을 기대하지 말라. 이것은 오히려 단일 데이터 스트림으로부터 치명적 망각 없이 지속학습이 가능하다는 것을 보여주는 작은 실험이다. 게다가 그것이 저사양 하드웨어에서도 가능하다. 즉, 거의 모든 사람이 자기 자신의 버전의 모델을 자신이 원하는 대로 학습하거나(또는 이 모델의 학습을 단순히 계속하거나) 할 수 있다. 그리고 그 능력은 실제 하드웨어, 이용 가능한 데이터의 규모와 품질, 그리고 학습에 투자하려는 시간에 의해 결정된다.

미니 런 대시보드는 다음과 같이 생겼다. 모델은 지속적으로 읽고 학습할 말뭉치(corpus)를 가리킨다. History에는 지금까지 전체 학습 실행 이력의 샘플들이 있다. 직접 검토해보면 학습/말뭉치 읽기 과정 동안 모델이 어떻게 발전했는지 확인할 수 있다. 가중치는 아직 공개되지 않았다. 현재 실행은 말뭉치의 첫 패스를 읽는 중이며, 전부 읽고 나면 가중치가 업로드될 것이다. 현재 속도로는 몇 주 정도 남았다.

동기 오늘날 실제로 소유할 수 있는 모든 언어모델은 누군가 학습시킨 뒤 동결(freeze)한 모델이다. 가장자리에서 파인튜닝은 할 수 있지만, 자신의 하드웨어로 처음부터 학습할 수는 없고, 일상에서 하는 일로 계속 학습시킬 수도 없다. 시도하는 순간 이전에 알던 것을 잊어버리기 때문이다. 그 결과, 개인 모델은 언제나 '남의 모델 위에 얇은 자기 자신의 층'일 뿐이고, 출하되는 날 학습을 멈춘다.

mini-AGI 모델은 GPU 사용량이 충분히 작아 소비자용 카드 한 장으로 엔드투엔드 학습이 가능하며, 학습이 절대 멈출 필요가 없도록 설계되었다. 문자 스트림을 한 청크씩 읽고 각각에 대해 그래디언트 스텝을 밟으며, 동일한 경로가 생성(generation)을 담당한다. 별도의 파인튜닝 체제도, 동결된 베이스도 없다. 읽는 것과 학습되는 것이 같은 사건이다.

설계의 나머지 모든 것을 결정하는 세 가지 제약이 있다:

  1. 8GB에 들어가야 한다. 양자화(quantisation)로가 아니라 - 학습에는 그래디언트와 옵티마이저 상태가 필요하고, 이는 대략 가중치의 3배 크기다. 따라서 가중치는 디스크에 두고 작업 집합(working set)만 상주시킨다.
  2. 잊지 말아야 한다. 지속적으로 학습하면서 자기 자신을 덮어써버리는 모델은 아예 학습하지 않는 모델보다 나쁘다.
  3. 무엇이든 읽을 수 있어야 한다. 알파벳은 256개의 바이트 값이므로, 맞춰야 할 토크나이저도 없고 새 어휘가 필요한 데이터 타입도 없다.

이 모델은 진정으로 당신 것이다. 당신의 하드웨어에서, 당신의 데이터로 학습되고, 당신과 나누는 모든 대화에서 계속 학습하며, 누구도 그것을 가져가거나 끌 수 없다.

아키텍처 동작 방식 문자(바이트)는 전통적인 LLM처럼 고정된 층 스택을 통과하지 않는다. 대신 두 개의 dense prelude 블록을 통과한 뒤, 하나의 순환(recurrent) 블록이 최대 24회 적용되며, 각 적용은 공유 풀에서 자신의 익스퍼트를 선택한다. 적용 사이의 잠재 상태(latent state)는 절대 디코딩되지 않으며, 매번 어댑터를 통해 임베딩된 입력과 병합되므로, 루프가 읽고 있는 텍스트에서 벗어나 표류할 수 없다. 문자당 최대 26개의 블록 적용이 있는 세 개의 서로 다른 블록이다.

적응적 깊이(Adaptive depth). 정지(halting) 헤드가 모든 행에서 모든 문자에 점수를 매기고, 다른 행이 답을 바꾸지 않는다고 판단되면 문자 처리를 멈춘다. 쉬운 문자는 한 행, 어려운 문자는 여러 행을 사용한다.

원문 보기
원문 보기 (영어)
mini-AGI mini-AGI - is a continual learning byte-level language model that assembles its own architecture, trains from scratch on a single 8 GB VRAM GPU, and keeps learning from everything it reads. It stores its weights as ordinary files on disk and pages them onto the card as it needs them, so the parameter count is bounded by free disk space rather than by VRAM. It grows new capacity while training when it runs short, prunes what nothing asks for, and reads through exactly the same code path it serves on. Targeted at a PC or laptop with at least an 8 GB VRAM GPU on the board. NOTE: as of now this is a small toy-level model. Do not expect a frontier level capabilities. This is rather a small experiment to show, that continual learning from the single stream of data without catastrophic forgetting is possible. Furthermore it is possible on a modest hardware. Which means that almost everyone could train their own version of the model (or simply continue training this one) exactly as they see it fit. And the capabilities would be bounded by the actual hardware, scale and quality of the data available and the amount of time one willing to spend on training the model. Here is how min-run dashboard looks like. The model is pointed to the corpus to constantly read and learn from. History - here is the samples from the whole training run history so far. You can inspect them yourself to see how the model improved over the course of training/reading the corpus. The weights are not published yet . The run is still reading its first pass over the corpus, the weights go up once it has been through all of it, which is a couple of weeks away at the current rate. Motivation Every language model you can actually own today is a model somebody else trained and then froze. You can fine-tune around the edges of it, but you cannot train one from scratch on your own hardware, and you cannot keep training it on what you do day to day - the moment you try, it forgets what it knew before. The result is that a personal model is always somebody else's model with a thin layer of you on top, and it stops learning the day it ships. mini-AGI model has small enough GPU footprint that it is possible to train end-to-end on one consumer card, and it is built so that training never has to stop. It reads a stream of characters one chunk at a time, takes a gradient step on each, and the same path serves generation. There is no separate fine-tuning regime and no frozen base: reading and being trained are the same event. Three constraints shape everything else in the design: It has to fit on 8 GB. Not with quantisation - training needs gradients and optimiser state, which is roughly three times the weights again. So the weights live on disk and only the working set is resident. It has to not forget. A model that learns continually and overwrites itself is worse than one that does not learn at all. It has to be able to read anything. The alphabet is the 256 byte values, so there is no tokenizer to fit and no data type that needs a new vocabulary. The model is genuinely yours: trained on your hardware, on your data, that keeps learning from every conversation you have with it, and that nobody else can take it away or switch it off. How the architecture works Characters (bytes) does not pass through a fixed stack of layers as it would be in a traditional LLM. Instead, it passes through two dense prelude blocks and then through one recurrent block applied up to 24 times , each application choosing its own experts from a shared pool. The latent state between applications is never decoded - it is merged with the embedded input by an adapter each time round, so the loop cannot drift away from the text it is reading. Three distinct blocks, up to 26 block-applications per character. Adaptive depth. A halting head scores every character at every row, and the character stops as soon as another row would not change the answer. Easy characters take one row, hard ones take many. This is the PonderNet recipe: while training, every depth is computed and weighted by its halting probability, so the halting head learns through those weights. Routing per block-application, not per character. Each of the 26 applications picks its own top-8 experts, so one character touches far more of the pool than "top-8" suggests, and the same expert can be selected several times at different depths. What varies is which eight at each point. No expert is assigned a subject. There are no labels anywhere. Soft top-k routing distributes capability across the pool by itself, and a character can combine fragments from several experts. The cost is that capabilities share parameters and so can interfere. This is the architecture assembling itself, one character at a time , captured from the live model - nothing here is drawn by hand. Each tile on the left is one expert; colour is expert identity and stays the same for the whole clip. A row is one application of the recurrent block, and the eight tiles in it are the eight experts that row actually ran. The stack grows downward as the model keeps going, and the amber line is where halting stopped it - the grey rows below are computation the model declined to spend. The trace on the right is how many rows each character took. It moves constantly between 4 and 14 against a ceiling of 24, and the caret under the text shows which character is being read. Positions are rotary and carry no learned parameters, which is why the context window can be extended by continued training rather than by re-initialising anything. ...and the same thing while it writes The clip above is the model reading - every character is held-out text it is being shown. This one is the model writing : it was primed with 2,500 characters of a held-out story and then continued on its own, so the grey text is what it was given and the green text is entirely its own . Greedy decoding, no sampling anywhere - run it twice and you get the same sentence. Two things are worth watching. The stack behaves the same way, because generating and reading are the same forward pass in this model - the only difference is whether the next character comes from a file or from the model's own argmax. And writing costs more depth than reading : about 9.9 rows a character against 8.0 on the same subject. The dotted lines mark where the working set was re-chosen, which happens every 64 characters; in this clip nothing swapped, because the prompt had already pulled the right experts onto the card. What it produced, continuing a story about a cherry tree: They worked together and saw their favorite shore. One day, they wanted to play with their favorite shore. They wanted to play with it, but Grammatically correct and on-topic. It does repeats itself for now - which is a fair picture of where the model is at 243M characters. How paging works Every expert is a file on disk holding its weights and its Adam moments. Above disk sit two caches and a working set: key what it is disk — every expert the model has; bounded by free space RAM ram_cache recently wanted experts, least-recently-used evicted VRAM resident the working set - what a character may route through Before every chunk the model is asked what the text about to be read wants, and the answer becomes the working set. Demand is scored on the hidden states the call sites actually routed on while reading the previous chunk - an embedding carries no context, so scoring on raw embeddings would have every subject asking for the same experts. Two rules the project holds to: Adam's moments travel with the expert. They belong to the expert, not to the slot of VRAM it happened to occupy. Leaving them behind would hand one expert's momentum to whatever took its place, and training would carry on looking healthy while every swapped expert inherited a stranger's history. An expert already on the card stays in the slot it is in. Demand comes back sorted, so the order churns while the set itself bar