Text Generation
Transformers
Safetensors
GGUF
English
music
playlist
recommendation
generative-retrieval
semantic-ids
qwen3
conversational
Instructions to use asharrm/juke-1.7b-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use asharrm/juke-1.7b-dev with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="asharrm/juke-1.7b-dev")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("asharrm/juke-1.7b-dev", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use asharrm/juke-1.7b-dev with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf asharrm/juke-1.7b-dev:Q8_0 # Run inference directly in the terminal: llama cli -hf asharrm/juke-1.7b-dev:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf asharrm/juke-1.7b-dev:Q8_0 # Run inference directly in the terminal: llama cli -hf asharrm/juke-1.7b-dev:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf asharrm/juke-1.7b-dev:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf asharrm/juke-1.7b-dev:Q8_0
Use Docker
docker model run hf.co/asharrm/juke-1.7b-dev:Q8_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use asharrm/juke-1.7b-dev with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "asharrm/juke-1.7b-dev" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "asharrm/juke-1.7b-dev", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/asharrm/juke-1.7b-dev:Q8_0
- SGLang
How to use asharrm/juke-1.7b-dev with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "asharrm/juke-1.7b-dev" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "asharrm/juke-1.7b-dev", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "asharrm/juke-1.7b-dev" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "asharrm/juke-1.7b-dev", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use asharrm/juke-1.7b-dev with Ollama:
ollama run hf.co/asharrm/juke-1.7b-dev:Q8_0
- Unsloth Desktop
- Pi
How to use asharrm/juke-1.7b-dev with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf asharrm/juke-1.7b-dev:Q8_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "asharrm/juke-1.7b-dev:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use asharrm/juke-1.7b-dev with Docker Model Runner:
docker model run hf.co/asharrm/juke-1.7b-dev:Q8_0
- Lemonade
How to use asharrm/juke-1.7b-dev with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull asharrm/juke-1.7b-dev:Q8_0
Run and chat with the model
lemonade run user.juke-1.7b-dev-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use asharrm/juke-1.7b-dev with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf asharrm/juke-1.7b-dev:Q8_0
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default asharrm/juke-1.7b-dev:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use asharrm/juke-1.7b-dev with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf asharrm/juke-1.7b-dev:Q8_0
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "asharrm/juke-1.7b-dev:Q8_0" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Model card: detailed v1.0 -> v1.1 weight-edit write-up
Browse files
README.md
CHANGED
|
@@ -144,34 +144,104 @@ semantic-ID generative retrieval work.
|
|
| 144 |
- **Versions in this repo:** `v1.1/` (recommended: `final/` plus the head edit below), `final/` (end of round 8), and the
|
| 145 |
`pass7/` and `pass6/` checkpoints.
|
| 146 |
|
| 147 |
-
## What's new in v1.1
|
| 148 |
|
| 149 |
-
v1.0 (`final/`) sometimes listed the same song twice in one playlist
|
| 150 |
-
Everybody Knows* three times
|
|
|
|
| 151 |
|
| 152 |
-
1.
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
how much it raises the log-probability of a *repeated* song address relative to a fresh one.
|
| 156 |
-
4. **Intervene:** 21 candidate edits are scored on held-out playlists against random-unit controls. Switching off
|
| 157 |
-
"repeat-promoting" neurons or ablating the probe direction lowered repeats *and* normal picks alike. Boosting the four
|
| 158 |
-
strongest **repeat-suppressing heads** (L22 h8, L22 h7, L26 h7, L16 h14) was selective.
|
| 159 |
-
5. **Apply:** multiply those heads' columns in `o_proj` by 2. That is 4 Γ 128 columns, about 0.03% of the weights.
|
| 160 |
|
| 161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|---|---|---|
|
| 163 |
-
|
|
| 164 |
-
|
|
| 165 |
-
|
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
## Evaluation (v1.0 `final/`, greedy, 110 prompts; v1.1 numbers above)
|
| 177 |
|
|
|
|
| 144 |
- **Versions in this repo:** `v1.1/` (recommended: `final/` plus the head edit below), `final/` (end of round 8), and the
|
| 145 |
`pass7/` and `pass6/` checkpoints.
|
| 146 |
|
| 147 |
+
## What's new in v1.1: fixing repeats by editing the weights
|
| 148 |
|
| 149 |
+
v1.0 (`final/`) sometimes listed the same song twice in one playlist. About **5% of tracks were repeats**, e.g.
|
| 150 |
+
*Leonard Cohen β Everybody Knows* three times in "dark cabaret heartbreak". The usual fix is more fine-tuning. Instead
|
| 151 |
+
we found the circuit responsible and **edited it directly: no gradient steps, no new data, about 0.03% of the weights**.
|
| 152 |
|
| 153 |
+
### 1. Collect the behaviour
|
| 154 |
+
Greedy-decode 400 playlists from training prompts that the evaluation does not use. Label every list item as
|
| 155 |
+
**repeat** (its 3-token song address already appeared earlier in the list) or **fresh**: 239 repeats and 3,692 fresh.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
|
| 157 |
+
### 2. Where is "about to repeat" visible? (correlational)
|
| 158 |
+
At the position that predicts each item's first address token, take the residual stream at every layer. The
|
| 159 |
+
difference of class means gives a direction, scored on a held-out half by Cohen's *d*:
|
| 160 |
+
|
| 161 |
+
| layers | 1β9 | 10β15 | **16β19** | 20β21 | 22β28 |
|
| 162 |
+
|---|---|---|---|---|---|
|
| 163 |
+
| Cohen's *d* | 0.6β1.1 | 0.4β0.95 | **1.4β1.6** | 1.05β1.3 | 0.4β0.9 |
|
| 164 |
+
|
| 165 |
+
The decision is most legible in the middle-late layers. Correlation is not causation, so we went one step further.
|
| 166 |
+
|
| 167 |
+
### 3. Which units cause it? (attribution patching)
|
| 168 |
+
For each list item, target = log p(the item's 3 address tokens). For every MLP neuron (`down_proj` input) and every
|
| 169 |
+
attention head (its slice of the `o_proj` input), attribution = activation Γ βtarget/βactivation, summed over the
|
| 170 |
+
3 predicting positions. Then:
|
| 171 |
+
|
| 172 |
+
repeat score = mean attribution on **repeated** items β mean attribution on **fresh** items
|
| 173 |
+
|
| 174 |
+
The largest scores were *negative*, meaning units that push repeats down. These are **copy-suppression heads** that look
|
| 175 |
+
back at songs already listed and lower their probability:
|
| 176 |
+
|
| 177 |
+
| head | repeat score |
|
| 178 |
+
|---|---|
|
| 179 |
+
| L22 h8 | β0.068 |
|
| 180 |
+
| L22 h7 | β0.046 |
|
| 181 |
+
| L26 h7 | β0.042 |
|
| 182 |
+
| L16 h14 | β0.040 |
|
| 183 |
+
| (most repeat-promoting: L15 h6) | +0.028 |
|
| 184 |
+
|
| 185 |
+
### 4. Test edits causally, against controls
|
| 186 |
+
Each candidate edit was applied to a fresh copy of the weights and scored by teacher forcing on held-out playlists
|
| 187 |
+
(eval prompts). Ξ is the change in mean log-probability of repeated vs. fresh items; we want Ξrepeat βͺ Ξfresh β 0.
|
| 188 |
+
|
| 189 |
+
| edit | Ξ repeat | Ξ fresh | |
|
| 190 |
+
|---|---|---|---|
|
| 191 |
+
| 8 / 32 / 128 random neurons β 0 (control) | 0.00 / 0.00 / β0.03 | 0.00 / 0.00 / β0.01 | control is flat β
|
|
| 192 |
+
| top 8 / 32 / 128 repeat-promoting neurons β 0 | β0.33 / β0.91 / β1.90 | β0.27 / β0.65 / β1.49 | hurts everything β |
|
| 193 |
+
| remove the probe direction (layers 15β19) | β0.41 | β0.41 | not selective β |
|
| 194 |
+
| boost top anti-repeat neurons Γ1.5β2 | β0.06 to β0.21 | β0.03 to β0.11 | too weak |
|
| 195 |
+
| top 2 / 4 repeat-promoting heads β 0 | β0.49 / β0.82 | β0.26 / β0.53 | partly selective |
|
| 196 |
+
| **4 copy-suppression heads Γ1.5** | **β0.68** | **β0.25** | selective β
|
|
| 197 |
+
| **4 copy-suppression heads Γ2** | **β1.64** | **β0.60** | **chosen** β
|
|
| 198 |
+
| 4 copy-suppression heads Γ3 | β3.81 | β1.51 | starts to damage |
|
| 199 |
+
|
| 200 |
+
### 5. The edit
|
| 201 |
+
```python
|
| 202 |
+
import torch
|
| 203 |
+
from transformers import AutoModelForCausalLM
|
| 204 |
+
m = AutoModelForCausalLM.from_pretrained("asharrm/juke-1.7b-dev", subfolder="final", torch_dtype=torch.bfloat16)
|
| 205 |
+
hd = m.config.head_dim # 128
|
| 206 |
+
with torch.no_grad():
|
| 207 |
+
for layer, head in [(22, 8), (22, 7), (26, 7), (16, 14)]:
|
| 208 |
+
m.model.layers[layer].self_attn.o_proj.weight[:, head * hd:(head + 1) * hd] *= 2.0
|
| 209 |
+
m.save_pretrained("juke-1.7b-v1.1")
|
| 210 |
+
```
|
| 211 |
+
That is 4 Γ 128 columns of `o_proj`: 1.05M of 1.7B weights, about **0.03%**.
|
| 212 |
+
|
| 213 |
+
### 6. Result (greedy decoding, 110 prompts, real generation)
|
| 214 |
+
|
| 215 |
+
| metric | v1.0 `final/` | Γ1.5 | **v1.1 (Γ2)** |
|
| 216 |
+
|---|---|---|---|
|
| 217 |
+
| repeated tracks inside a playlist | 5.0% | 2.9% | **1.8%** |
|
| 218 |
+
| song addresses that exist | 99.9% | 100% | 99.9% |
|
| 219 |
+
| song name matches its address | 96.6% | 97.1% | **98.0%** |
|
| 220 |
+
| distinct songs across 40 unrelated prompts | 90.9% | 91.7% | 93.0% |
|
| 221 |
+
| overlap with teacher playlists (trained prompts) | 7.2% | 5.9% | 5.6% |
|
| 222 |
+
|
| 223 |
+
Before and after:
|
| 224 |
+
|
| 225 |
+
| prompt | v1.0 | v1.1 |
|
| 226 |
|---|---|---|
|
| 227 |
+
| dark cabaret heartbreak | Leonard Cohen β Everybody Knows Γ3 | The Dresden Dolls, Nellie McKay, Cold Cave, no repeats |
|
| 228 |
+
| wistful indie rock from the 2000s | The Postal Service β Sleeping In Γ3 | Jimmy Eat World, Bright Eyes, Death Cab for Cutie, Dashboard Confessional, The Shinsβ¦ |
|
| 229 |
+
| weird punk songs | The Adverts Γ2 | Misfits, Bad Brains, Black Flag, Television, Dead Kennedys, The Undertones |
|
| 230 |
+
|
| 231 |
+
**Side effect:** where the model knows few songs in a genre, it now drifts to a neighbouring style more often instead of
|
| 232 |
+
repeating. For example, "banda" gave cumbia and mambo. The edit removes an obstacle; it cannot add songs the model never
|
| 233 |
+
learned, which matches the weight-space-programming finding below.
|
| 234 |
+
|
| 235 |
+
### Why this worked
|
| 236 |
+
The training data never contained repeats, so the model learned a copy-suppression mechanism. It was simply too quiet,
|
| 237 |
+
and greedy decoding sometimes let a strongly-recalled song win twice. Turning up a mechanism that already exists is a
|
| 238 |
+
targeted fix. Switching off neurons that merely *correlate* with repeats damaged everything.
|
| 239 |
+
|
| 240 |
+
Inspired by: *Neural Networks Are Already Clean* (Cammarata, Goodfire, 2026). The "Evil Qwen" single-neuron reproductions
|
| 241 |
+
(HedwigAI, 2026), where the most active neurons were not the causal ones, so rank by causal attribution and check random
|
| 242 |
+
controls. Copy-suppression heads catalogued in neuron-lens (stdlogits). *Sparks of Weight-Space Programming* (Takehi,
|
| 243 |
+
Teoh, Zhang & Khattab, MIT CSAIL, 2026). Scripts: `repeat_direction.py`, `repeat_attrib.py`, `repeat_edit_test.py`,
|
| 244 |
+
`repeat_apply.py` in the juke repo.
|
| 245 |
|
| 246 |
## Evaluation (v1.0 `final/`, greedy, 110 prompts; v1.1 numbers above)
|
| 247 |
|