CodeSoft commited on
Commit
5f19261
·
verified ·
1 Parent(s): 60f0f3a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +101 -0
README.md CHANGED
@@ -1,3 +1,104 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ datasets:
4
+ - HuggingFaceTB/smol-smoltalk
5
+ - HuggingFaceH4/no_robots
6
+ language:
7
+ - en
8
+ base_model:
9
+ - CodeSoft/MetaDiffusion-150M-exp
10
+ pipeline_tag: text-generation
11
+ tags:
12
+ - text-generation
13
+ - transformer
14
+ - diffusion-language-model
15
+ - chat
16
+ - metadiffusion
17
  ---
18
+
19
+ # MetaDiffusion-150M-ChatBase
20
+
21
+ MetaDiffusion-150M-ChatBase is a masked-diffusion language model converted from an autoregressive base model and chat-tuned for downstream experimentation. It uses bidirectional attention with timestep conditioning and generates text through iterative masked denoising with left-to-right block commitment. Built by chat tuning [CodeSoft/MetaDiffusion-150M-exp](https://huggingface.co/CodeSoft/MetaDiffusion-150M-exp) on smol-smoltalk (460K conversations, Apache-2.0) + no_robots (9.5K, Apache-2.0).
22
+
23
+ - Architecture: 16L x 768W, 169.5M params, bidirectional attention, timestep
24
+ conditioning, 32,010 vocab (ChatML tokens added), context 5120
25
+ - Weights: fp16 safetensors (339 MB), untied lm_head
26
+ - Generation: masked denoising (left-to-right block commit, 128 steps default)
27
+
28
+ ## Intended use
29
+ Downstream fine-tuning for specific tasks. This is NOT designed for production, instruction following is weak and coherent output is limited to roughly 60-100 tokens.
30
+
31
+ ## Quickstart (chat)
32
+
33
+ ```bash
34
+ pip install -r scripts/requirements.txt
35
+
36
+ # Interactive, with live denoising view (--watch):
37
+ python scripts/chat.py --model-path . --watch
38
+
39
+ # One-shot:
40
+ python scripts/chat.py --model-path . --prompt "What is the capital of France?"
41
+ ```
42
+
43
+ The `--watch` flag shows the response denoising in real time: step count,
44
+ noise level t, masks remaining, and the partial text building into place.
45
+ Generation defaults live in `generation_config.json` (128 steps, 96-token
46
+ block, temperature 0.7, repetition penalty 1.5).
47
+
48
+ ## Fine-tune it
49
+
50
+ ```bash
51
+ # 1. Your data:
52
+ # a) HF dataset names (no_robots, alpaca, dolly, smol-smoltalk, math)
53
+ python scripts/prepare_data.py --model-path . \
54
+ --data-dir my_data --datasets no_robots
55
+
56
+ # b) Local ChatML files: .jsonl, .json, .parquet (messages/instruction shapes)
57
+ python scripts/convert_data.py --model-path . --input my_chat.jsonl \
58
+ --output my_data
59
+ python scripts/convert_data.py --model-path . --input ./data_folder \
60
+ --output my_data
61
+
62
+ # 2. Train
63
+ python scripts/train_chat.py --model-path . \
64
+ --data-dir my_data --output-dir my_checkpoints \
65
+ --lr 7e-5 --epochs 3 --patience 6
66
+
67
+ # 3. Chat with your model
68
+ python scripts/chat.py --model-path my_checkpoints/best.pt \
69
+ --tokenizer my_data/tokenizer --watch
70
+
71
+ # 4. Export a new release artifact (self-packages the scripts too)
72
+ python scripts/export_hf.py --checkpoint my_checkpoints/best.pt \
73
+ --tokenizer my_data/tokenizer --output ./MetaDiffusion-150M-MyTask --fp16
74
+ ```
75
+
76
+ The whole pipeline runs on a single consumer GPU.
77
+
78
+ ## Behavior
79
+
80
+ The model returns coherent sentences but loses coherence and factuality over multi-turn conversations.
81
+
82
+ ## Generation notes
83
+
84
+ - Left-to-right (semi-autoregressive) block commit: confidence-based unmasking
85
+ lets `<|im_end|>` win at position 0 and produced empty responses on this
86
+ architecture at 150M; left-to-right fixed it (verified).
87
+ - Denoising stops early once `<|im_end|>` is committed.
88
+
89
+ ## Model lineage
90
+
91
+ MetaDiffusion-150M-ChatBase is derived through the following process:
92
+
93
+ 1. Start from `SupraLabs/Supra-1.5-50M-Base-exp`.
94
+ 2. Convert the autoregressive model into a masked-diffusion architecture.
95
+ 3. Continue pre-training on FineWeb-EDU.
96
+ 4. Expand the model to 150M parameters.
97
+ 5. Continue pretraining on The Pile.
98
+ 6. Chat-tune on `HuggingFaceTB/smol-smoltalk` and `HuggingFaceH4/no_robots`.
99
+
100
+ The resulting model uses bidirectional attention and timestep conditioning rather than conventional causal attention.
101
+
102
+ ## License details
103
+
104
+ Apache-2.0