kotl1nML commited on
Commit
c2ca258
·
verified ·
1 Parent(s): f89aec5

Lin-1.1 Epsilon: weights, model card and benchmarks

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ Lin-1.1-Epsilon-benchmarks.png filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
Lin-1.1-Epsilon-benchmarks.png ADDED

Git LFS Details

  • SHA256: 3f76c15a50333f51baccf93fdf831f3c02ba6f640594cc56bd7861594ff39445
  • Pointer size: 131 Bytes
  • Size of remote file: 189 kB
README.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen2.5-Coder-0.5B-Instruct
4
+ language:
5
+ - en
6
+ pipeline_tag: text-generation
7
+ library_name: transformers
8
+ tags:
9
+ - code
10
+ - rust
11
+ - lindot
12
+ ---
13
+
14
+ # Lin-1.1 Epsilon
15
+
16
+ **Lin-1.1 Epsilon** is a 0.5B-parameter Rust code model from LindotAI, fine-tuned from [Qwen2.5-Coder-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-0.5B-Instruct). It is small enough to run on a laptop CPU and is meant for quick completions, simple functions and generate-and-test loops. Its bigger sibling is [Lin-1 Locus](https://huggingface.co/LindotAI/Lin-1-Locus) (4B).
17
+
18
+ 1.1 replaces Lin-1 Epsilon Preview. It improves pass@1 on HumanEval-Rust and MBPP-Rust, our private holdout (+4.1 points) and LBPP-Rust. The Preview stays available at [LindotAI/Lin-1-Epsilon](https://huggingface.co/LindotAI/Lin-1-Epsilon).
19
+
20
+ ![Benchmarks](Lin-1.1-Epsilon-benchmarks.png)
21
+
22
+ ## Benchmarks
23
+
24
+ All numbers were measured by us with the same harness for every model. The benchmarks are Rust ports; generated code is compiled and run against the tests. pass@1 and pass@10 are computed from 10 samples per problem.
25
+
26
+ | Model | HumanEval-Rust p@1 / p@10 | MBPP-Rust p@1 / p@10 | Holdout (Rust) | LBPP-Rust |
27
+ |---|---|---|---|---|
28
+ | **Lin-1.1 Epsilon (0.5B)** | **49.4** / 63.3 | 43.9 / **54.4** | **34.4** | **4.73** |
29
+ | Lin-1 Epsilon Preview (0.5B) | 48.4 / **65.2** | 41.3 / 54.2 | 30.3 | 4.11 |
30
+ | Temper 2 Ion (0.5B) | 48.1 / 57.6 | **45.5** / 53.8 | 31.0 | 4.50 |
31
+ | Temper 1 0.5B | 36.3 / 46.3 | 39.3 / 46.9 | — | — |
32
+ | ThoxEdge-RustCoder-0.5B | 28.7 / 44.8 | 33.2 / 43.1 | — | — |
33
+ | Qwen2.5-Coder-0.5B-Instruct (base) | 23.8 / — | — | — | — |
34
+ | Qwen3.5-0.8B | 10.1 / 22.1 | 14.5 / 25.5 | — | — |
35
+
36
+ *Holdout* is a set of 1,726 Rust tasks with tests that is never used for training. *LBPP-Rust* (129 tasks) is a harder problem set than MBPP; small models solve few of its problems, so differences there are small in absolute terms.
37
+
38
+ ## Quick start
39
+
40
+ ```python
41
+ from transformers import AutoTokenizer, AutoModelForCausalLM
42
+
43
+ model_id = "LindotAI/Lin-1.1-Epsilon"
44
+ tok = AutoTokenizer.from_pretrained(model_id)
45
+ model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
46
+
47
+ messages = [{"role": "user", "content": "Write a Rust function that checks whether a string is a palindrome."}]
48
+ inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
49
+ out = model.generate(inputs, max_new_tokens=512, temperature=0.2, do_sample=True)
50
+ print(tok.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
51
+ ```
52
+
53
+ GGUF builds (Q8_0, Q4_K_M) are in [LindotAI/Lin-1.1-Epsilon-GGUF](https://huggingface.co/LindotAI/Lin-1.1-Epsilon-GGUF).
54
+
55
+ ```bash
56
+ llama-cli -hf LindotAI/Lin-1.1-Epsilon-GGUF:Q8_0 -p "Write a Rust function that reverses a Vec<i32> in place."
57
+ ```
58
+
59
+ Recommended sampling: temperature 0.2 for single answers, 0.8 when sampling several candidates and testing them.
60
+
61
+ ## Training
62
+
63
+ 1. Supervised fine-tuning of Qwen2.5-Coder-0.5B-Instruct on curated, compile-checked Rust.
64
+ 2. Reinforcement learning (GRPO) with a test-pass reward, then a weight average of the SFT and RL checkpoints (Lin-1 Epsilon Preview).
65
+ 3. New in 1.1: five further GRPO rounds on Rust tasks with unit tests, each starting from the previous round; the last four rounds used 2,000 new, previously unseen tasks each. The reward uses a pass@k-style advantage. HumanEval-Rust pass@10 is 1.9 points lower than in the Preview; every other score is higher.
66
+
67
+ All training data was decontaminated against the evaluation sets (HumanEval, MBPP, LBPP and the holdout) with a 12-gram overlap filter and exact matching.
68
+
69
+ ## Limitations
70
+
71
+ - A 0.5B model makes more mistakes than larger ones on multi-step logic; LBPP-level problems are mostly out of reach.
72
+ - Focused on Rust. Always compile and test generated code.
73
+
74
+ ## License
75
+
76
+ Apache 2.0, same as the base model.
chat_template.jinja ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0]['role'] == 'system' %}
4
+ {{- messages[0]['content'] }}
5
+ {%- else %}
6
+ {{- 'You are Lin Epsilon, a 500M-parameter AI model for Rust programming. You are a helpful assistant.' }}
7
+ {%- endif %}
8
+ {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
9
+ {%- for tool in tools %}
10
+ {{- "\n" }}
11
+ {{- tool | tojson }}
12
+ {%- endfor %}
13
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
14
+ {%- else %}
15
+ {%- if messages[0]['role'] == 'system' %}
16
+ {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
17
+ {%- else %}
18
+ {{- '<|im_start|>system\nYou are Lin Epsilon, a 500M-parameter AI model for Rust programming. You are a helpful assistant.' }}
19
+ {%- endif %}
20
+ {%- endif %}
21
+ {%- for message in messages %}
22
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
23
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
24
+ {%- elif message.role == "assistant" %}
25
+ {{- '<|im_start|>' + message.role }}
26
+ {%- if message.content %}
27
+ {{- '\n' + message.content }}
28
+ {%- endif %}
29
+ {%- for tool_call in message.tool_calls %}
30
+ {%- if tool_call.function is defined %}
31
+ {%- set tool_call = tool_call.function %}
32
+ {%- endif %}
33
+ {{- '\n<tool_call>\n{"name": "' }}
34
+ {{- tool_call.name }}
35
+ {{- '", "arguments": ' }}
36
+ {{- tool_call.arguments | tojson }}
37
+ {{- '}\n</tool_call>' }}
38
+ {%- endfor %}
39
+ {{- '<|im_end|>\n' }}
40
+ {%- elif message.role == "tool" %}
41
+ {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
42
+ {{- '<|im_start|>user' }}
43
+ {%- endif %}
44
+ {{- '\n<tool_response>\n' }}
45
+ {{- message.content }}
46
+ {{- '\n</tool_response>' }}
47
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
48
+ {{- '<|im_end|>\n' }}
49
+ {%- endif %}
50
+ {%- endif %}
51
+ {%- endfor %}
52
+ {%- if add_generation_prompt %}
53
+ {{- '<|im_start|>assistant\n' }}
54
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "dtype": "bfloat16",
8
+ "eos_token_id": 151645,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 896,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 4864,
13
+ "layer_types": [
14
+ "full_attention",
15
+ "full_attention",
16
+ "full_attention",
17
+ "full_attention",
18
+ "full_attention",
19
+ "full_attention",
20
+ "full_attention",
21
+ "full_attention",
22
+ "full_attention",
23
+ "full_attention",
24
+ "full_attention",
25
+ "full_attention",
26
+ "full_attention",
27
+ "full_attention",
28
+ "full_attention",
29
+ "full_attention",
30
+ "full_attention",
31
+ "full_attention",
32
+ "full_attention",
33
+ "full_attention",
34
+ "full_attention",
35
+ "full_attention",
36
+ "full_attention",
37
+ "full_attention"
38
+ ],
39
+ "max_position_embeddings": 32768,
40
+ "max_window_layers": 24,
41
+ "model_type": "qwen2",
42
+ "num_attention_heads": 14,
43
+ "num_hidden_layers": 24,
44
+ "num_key_value_heads": 2,
45
+ "pad_token_id": null,
46
+ "rms_norm_eps": 1e-06,
47
+ "rope_parameters": {
48
+ "rope_theta": 1000000.0,
49
+ "rope_type": "default"
50
+ },
51
+ "sliding_window": null,
52
+ "tie_word_embeddings": true,
53
+ "transformers_version": "5.14.1",
54
+ "use_cache": false,
55
+ "use_sliding_window": false,
56
+ "vocab_size": 151936
57
+ }
generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 151645,
6
+ 151643
7
+ ],
8
+ "pad_token_id": 151643,
9
+ "repetition_penalty": 1.05,
10
+ "temperature": 0.7,
11
+ "top_k": 20,
12
+ "top_p": 0.8,
13
+ "transformers_version": "5.14.1"
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b08e19ab2282e24e0c6602b39d490a8692e3966a7be44925cb8115a3e8efed25
3
+ size 988097824
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3fd169731d2cbde95e10bf356d66d5997fd885dd8dbb6fb4684da3f23b2585d8
3
+ size 11421892
tokenizer_config.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>"
22
+ ],
23
+ "is_local": true,
24
+ "local_files_only": false,
25
+ "model_max_length": 32768,
26
+ "pad_token": "<|endoftext|>",
27
+ "padding_side": "right",
28
+ "split_special_tokens": false,
29
+ "tokenizer_class": "Qwen2Tokenizer",
30
+ "unk_token": null
31
+ }