Transformers
Safetensors
natural-language-autoencoder
mechanistic-interpretability
activation-vectors
qwen2.5
nano-nla
Instructions to use lrohAmca/nano-nla-qwen05b-20k-step800 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lrohAmca/nano-nla-qwen05b-20k-step800 with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("lrohAmca/nano-nla-qwen05b-20k-step800", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add computed extraction metadata
Browse files
metadata/qwen05b_a100_stage0_computed.yaml
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model:
|
| 2 |
+
name: Qwen/Qwen2.5-0.5B-Instruct
|
| 3 |
+
d_model: 896
|
| 4 |
+
num_layers: 24
|
| 5 |
+
vocab_size: 151936
|
| 6 |
+
target_layer: 16
|
| 7 |
+
injection:
|
| 8 |
+
injection_char: ㈎
|
| 9 |
+
injection_token_id: 149705
|
| 10 |
+
injection_left_neighbor_id: 29
|
| 11 |
+
injection_right_neighbor_id: 522
|
| 12 |
+
injection_scale: 25.0
|
| 13 |
+
mse_scale: sqrt_d_model
|
| 14 |
+
prompts:
|
| 15 |
+
av: 'You are a meticulous AI researcher conducting an important investigation into
|
| 16 |
+
activation vectors from a language model. Your overall task is to describe the
|
| 17 |
+
semantic content of that activation vector.
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
We will pass the vector enclosed in <concept> tags into your context. You must
|
| 21 |
+
then produce an explanation for the vector, enclosed within <explanation> tags.
|
| 22 |
+
The explanation consists of 2-3 text snippets describing that vector.
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
Here is the vector:
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
<concept>{injection_char}</concept>
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
Please provide an explanation.
|
| 32 |
+
|
| 33 |
+
'
|
| 34 |
+
ar: 'Summary of the following text: <text>{explanation}</text> <summary>'
|
| 35 |
+
summary_system: 'You are an expert AI researcher analyzing language model activations.
|
| 36 |
+
Given a text snippet, describe what a language model''s internal state might represent
|
| 37 |
+
at the final token position.
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
Focus on:
|
| 41 |
+
|
| 42 |
+
- The semantic content and topic being processed
|
| 43 |
+
|
| 44 |
+
- What the model might be predicting or attending to next
|
| 45 |
+
|
| 46 |
+
- Key entities, relationships, or patterns in the text
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
Produce 2-3 concise bullet points. Be specific but brief.
|
| 50 |
+
|
| 51 |
+
'
|
| 52 |
+
summary_user: 'Here is the text that was being processed by the language model.
|
| 53 |
+
The activation was extracted at the final token position.
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
Text:
|
| 57 |
+
|
| 58 |
+
{text}
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
Describe what the model''s activation vector likely encodes at this point.
|
| 62 |
+
|
| 63 |
+
'
|
| 64 |
+
datagen:
|
| 65 |
+
corpus:
|
| 66 |
+
name: HuggingFaceFW/fineweb
|
| 67 |
+
config: sample-10BT
|
| 68 |
+
split: train
|
| 69 |
+
text_column: text
|
| 70 |
+
start: 0
|
| 71 |
+
length: 100000
|
| 72 |
+
extraction:
|
| 73 |
+
positions_per_doc: 10
|
| 74 |
+
max_length: 2048
|
| 75 |
+
min_position: 50
|
| 76 |
+
batch_size: 64
|
| 77 |
+
seed: 42
|
| 78 |
+
worker_devices:
|
| 79 |
+
- cuda:0
|
| 80 |
+
dtype: auto
|
| 81 |
+
shard_flush_rows: 20000
|
| 82 |
+
shard_flush_docs: 2000
|
| 83 |
+
resume: false
|
| 84 |
+
split:
|
| 85 |
+
av_sft_frac: 0.25
|
| 86 |
+
ar_sft_frac: 0.25
|
| 87 |
+
rl_frac: 0.5
|
| 88 |
+
seed: 42
|
| 89 |
+
summary_model:
|
| 90 |
+
provider: deepseek
|
| 91 |
+
local:
|
| 92 |
+
model: Qwen/Qwen2.5-7B-Instruct
|
| 93 |
+
device: auto
|
| 94 |
+
dtype: auto
|
| 95 |
+
batch_size: 8
|
| 96 |
+
chunk_size: 128
|
| 97 |
+
max_new_tokens: 300
|
| 98 |
+
max_input_chars: 2000
|
| 99 |
+
temperature: 0.3
|
| 100 |
+
top_p: 0.9
|
| 101 |
+
groq:
|
| 102 |
+
model: qwen/qwen3-32b
|
| 103 |
+
max_tokens: 300
|
| 104 |
+
temperature: 0.7
|
| 105 |
+
requests_per_minute: 30
|
| 106 |
+
max_retries: 5
|
| 107 |
+
retry_base_delay: 2.0
|
| 108 |
+
retry_max_delay: 60.0
|
| 109 |
+
batch_size: 1
|
| 110 |
+
chunk_size: 10
|
| 111 |
+
max_input_chars: 2000
|
| 112 |
+
deepseek:
|
| 113 |
+
model: deepseek-v4-flash
|
| 114 |
+
base_url: https://api.deepseek.com
|
| 115 |
+
max_tokens: 300
|
| 116 |
+
temperature: 0.7
|
| 117 |
+
requests_per_minute: 0
|
| 118 |
+
max_concurrency: 8
|
| 119 |
+
max_retries: 5
|
| 120 |
+
retry_base_delay: 2.0
|
| 121 |
+
retry_max_delay: 60.0
|
| 122 |
+
batch_size: 8
|
| 123 |
+
chunk_size: 80
|
| 124 |
+
max_input_chars: 2000
|
| 125 |
+
timeout_seconds: 120
|
| 126 |
+
output_dir: /content/nano-nla-stage0/generated
|
| 127 |
+
training:
|
| 128 |
+
sft:
|
| 129 |
+
device: auto
|
| 130 |
+
dtype: auto
|
| 131 |
+
learning_rate: 2.0e-05
|
| 132 |
+
weight_decay: 0.01
|
| 133 |
+
warmup_ratio: 0.05
|
| 134 |
+
lr_scheduler: cosine
|
| 135 |
+
max_grad_norm: 1.0
|
| 136 |
+
seed: 42
|
| 137 |
+
av:
|
| 138 |
+
batch_size: 32
|
| 139 |
+
gradient_accumulation_steps: 1
|
| 140 |
+
num_epochs: 1
|
| 141 |
+
max_response_length: 200
|
| 142 |
+
save_steps: 500
|
| 143 |
+
logging_steps: 10
|
| 144 |
+
output_dir: checkpoints/av_sft
|
| 145 |
+
ar:
|
| 146 |
+
batch_size: 32
|
| 147 |
+
gradient_accumulation_steps: 1
|
| 148 |
+
num_epochs: 1
|
| 149 |
+
save_steps: 500
|
| 150 |
+
logging_steps: 10
|
| 151 |
+
output_dir: checkpoints/ar_sft
|
| 152 |
+
rl:
|
| 153 |
+
device: auto
|
| 154 |
+
dtype: auto
|
| 155 |
+
actor_lr: 1.0e-05
|
| 156 |
+
critic_lr: 5.0e-05
|
| 157 |
+
grpo_group_size: 8
|
| 158 |
+
rollout_max_length: 200
|
| 159 |
+
kl_coeff: 0.05
|
| 160 |
+
num_steps: 1000
|
| 161 |
+
batch_size: 8
|
| 162 |
+
gradient_accumulation_steps: 1
|
| 163 |
+
save_interval: 100
|
| 164 |
+
logging_steps: 5
|
| 165 |
+
reward_log_transform: true
|
| 166 |
+
output_dir: checkpoints/rl
|
| 167 |
+
inference:
|
| 168 |
+
temperature: 1.0
|
| 169 |
+
max_new_tokens: 200
|
| 170 |
+
device: auto
|
| 171 |
+
dtype: auto
|
| 172 |
+
eval:
|
| 173 |
+
num_samples: 100
|
| 174 |
+
output_dir: results/eval
|
| 175 |
+
paths:
|
| 176 |
+
data_dir: data
|
| 177 |
+
checkpoint_dir: checkpoints
|
| 178 |
+
results_dir: results
|