uzr ๋ณด๊ด
Collection
2 items
โข
Updated
Universal Z-Rule Runner Architecture (Prototype)
https://github.com/10kseason/uzr
UZR
๊ฐ์ (Korean)
๋ชจ๋ธ ํ์ดํ๋ผ์ธ: ์
๋ ฅ ๋ฌธ์์ด์ ๋ฐ์ดํธ ๋จ์ ํ ํฌ๋์ด์ ๋ก ์ ๊ทํ๋์ด BOS/EOS ํ ํฐ๊ณผ ํจ๋ฉ์ด ํฌํจ๋ ์ํ์ค๋ก ๋ณํ๋ฉ๋๋ค.ใF:uzr/model.pyโ L10-L28ใ
ํํ ํ์ต๊ธฐ: TinyEncoder ํธ๋์คํฌ๋จธ๊ฐ ํ ํฐ ์๋ฒ ๋ฉ๊ณผ ์์น ์๋ฒ ๋ฉ์ ๊ฒฐํฉํด ๋ฌธ๋งฅ ํํ์ ๋ง๋ค๊ณ , FiLM ๊ณ์ธต์ด ์ธ์ดยท์ถ๋ก ์ ์ฌ ๋ฒกํฐ๋ฅผ ๊ฒฐํฉํ์ฌ ํ ํฐ๋ณ ๋ก์ง์ ์ฐ์ถํฉ๋๋ค.ใF:uzr/model.pyโ L43-L146ใ
์ ์ฌ ์ํ ์ตํฉ: UZRModel์ ๊ท์น ์ถ๋ก (z_rule), ์ฌ๊ณ ๋ณด์กฐ(z_think), ์ธ์ด ์๋ณ์ ์๋ฒ ๋ฉ์ ๊ฒฐํฉํด ๋จ์ผ ์กฐ๊ฑด ๋ฒกํฐ๋ก ํฌ์ํฉ๋๋ค.ใF:uzr/model.pyโ L62-L145ใ
์์ถ ๋ฉ๋ชจ๋ฆฌ: CompressedMemory๋ ํ๊ท ์๋ฒ ๋ฉ๊ณผ ๋๋ฆฐ ์ ์ฌ ๋ฒกํฐ๋ฅผ ์ ๊ทํ๋ ํค์ ํจ๊ป ์ ์ฅํ๊ณ , ์ฝ์ฌ์ธ ์ ์ฌ๋ ๊ธฐ๋ฐ ๊ฒ์ ๋ฐ MLP ํ์ต๊ธฐ๋ก ๋ณต์๊ฐ์ ์ถ์ ํฉ๋๋ค.ใF:uzr/memory.pyโ L37-L200ใใF:uzr/memory.pyโ L282-L287ใ
์ฅ๊ธฐ ์ถ๋ก ๋ฃจํ: ์ถ๋ก ์คํฌ๋ฆฝํธ๋ ํ์คํฌ ์ํ๋ง ํ ์ปจํ
์คํธ๋ฅผ ์ธ์ฝ๋ฉํ๊ณ , ๋ฉ๋ชจ๋ฆฌ์์ ์ด๊ธฐ z_fast๋ฅผ ๋ฐ์ ๋ด๋ถ ๊ฒฝ์ฌ ํ๊ฐ์ผ๋ก ์กฐ์ ํ ๋ค ๋๋ฆฐ ์ํ์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์
๋ฐ์ดํธํฉ๋๋ค.ใF:uzr/infer_longrun.pyโ L6-L170ใ
ํ์คํฌ ์์ฑ๊ธฐ: sample_task๋ ์ธ์ด๋ณ ๊ท์น ํฉํ ๋ฆฌ๋ฅผ ์กฐํฉํด ์ปจํ
์คํธยท์ฟผ๋ฆฌ ์์์ ์ค๋ช
์ ๋ฐํํ๋ฉฐ, ์ํ ๋ฑ ๊ตฌ์กฐํ๋ ์
๋ ฅ์ ์ ํ์ ์ผ๋ก ํผํฉํฉ๋๋ค.ใF:uzr/tasks.pyโ L361-L420ใ
Overview (English)
Model pipeline: Input strings are normalized by a byte-level tokenizer that inserts BOS/EOS markers and padding before batching them as tensors.ใF:uzr/model.pyโ L10-L28ใ
Representation learner: A TinyEncoder transformer fuses token and positional embeddings, while a FiLM layer conditions the sequence states with language and reasoning latents before projecting token logits.ใF:uzr/model.pyโ L43-L146ใ
Latent fusion: UZRModel merges rule inference (z_rule), thinking support (z_think), and language embeddings into a single control vector via a learned projection.ใF:uzr/model.pyโ L62-L145ใ
Compressed memory: CompressedMemory stores normalized keys with averaged embeddings and slow latents, serving cosine-similarity retrieval and an auxiliary MLP regressor to reconstruct stored codes.ใF:uzr/memory.pyโ L37-L200ใใF:uzr/memory.pyโ L282-L287ใ
Long-run inference loop: The inference script samples tasks, encodes contexts, seeds z_fast from memory, refines it with inner gradient steps, then updates the slow state and memory sketch.ใF:uzr/infer_longrun.pyโ L6-L170ใ
Task generator: sample_task blends language-specific rule factories to emit context/query pairs and human-readable descriptions, optionally injecting structured cases such as arithmetic.ใF:uzr/tasks.pyโ L361-L420ใ