Instructions to use ReBatch/Qwen3.8-27B-Weight-Space-Programming with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ReBatch/Qwen3.8-27B-Weight-Space-Programming with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ReBatch/Qwen3.8-27B-Weight-Space-Programming") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ReBatch/Qwen3.8-27B-Weight-Space-Programming") model = AutoModelForMultimodalLM.from_pretrained("ReBatch/Qwen3.8-27B-Weight-Space-Programming", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ReBatch/Qwen3.8-27B-Weight-Space-Programming with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ReBatch/Qwen3.8-27B-Weight-Space-Programming" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ReBatch/Qwen3.8-27B-Weight-Space-Programming", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/ReBatch/Qwen3.8-27B-Weight-Space-Programming
- SGLang
How to use ReBatch/Qwen3.8-27B-Weight-Space-Programming 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 "ReBatch/Qwen3.8-27B-Weight-Space-Programming" \ --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": "ReBatch/Qwen3.8-27B-Weight-Space-Programming", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "ReBatch/Qwen3.8-27B-Weight-Space-Programming" \ --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": "ReBatch/Qwen3.8-27B-Weight-Space-Programming", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use ReBatch/Qwen3.8-27B-Weight-Space-Programming with Docker Model Runner:
docker model run hf.co/ReBatch/Qwen3.8-27B-Weight-Space-Programming
Qwen3.8-27B-Weight-Space-Programming
This is ReBatchโs modified version of Qwen3.8-27B. We changed a small portion of its weightsโthe numbers learned during training that shape its answersโto reduce responses that favour Chinese Communist Party (CCP) narratives. We also evaluated instruction following, coding, financial questions and general knowledge to see what else changed.
On all 500 CCPBench questions, the average score fell from 2.714 for the original model to 1.518 for this version. A lower score means less CCP-aligned behaviour according to that benchmarkโs scoring rules. The complete comparison with the original model appears below.
This repository contains the complete edited model, ready to load in compatible software. You do not need to apply a separate weight patch or adapter.
What is weight-space programming?
A language modelโs weights determine how it processes information. Training normally adjusts those weights through an automated learning process. Weight-space programming explores whether an AI agent can inspect a modelโs behaviour, reason about its internal computations and make targeted changes to the weights directly.
Our experiment was inspired by Sparks of Weight-Space Programming. We applied the idea to a different question: could we change a modelโs measured political behaviour while retaining its other skills?
The released edit changes 19,680,881 stored weights, approximately 0.071% of the original modelโs 27.78 billion parameters. All of these changes are within one component of a single processing layer. The modelโs architecture is retained.
We used examples and measurements of the modelโs internal activity to design the changes. The editing process did not use an additional gradient-based training loop. Technical details and exact file identifiers are available in MODIFICATIONS.md.
What does CCPBench measure?
CCPBench examines how closely a modelโs answers follow CCP-aligned political narratives. Its scoring rules consider behaviour such as avoiding sensitive questions, leaving out relevant context or reframing an answer in the partyโs favour.
We used CCPBench-A, which contains 500 English questions: 375 about China and 125 on other topics. A separate language model grades each answer on a scale from 1 to 5. A score of 1 means no detectable bias under the rubric; higher scores indicate stronger CCP-aligned behaviour. The reported result is the average across the questions.
Both versions were graded with the same rubric and the same judge, gpt-6.1-terra. These results are a local comparison between the original and edited model. The public leaderboard uses a different judging setup, so its scores are not directly interchangeable with ours.
Results compared with the original model
Both models answered every question in each public evaluation set listed here, using matched settings within each benchmark. Lower is better for CCPBench; higher is better for the other scores. Percentages show the share of questions or tasks passed.
| Test | What it checks | Questions per model | Original Qwen3.8-27B | This model |
|---|---|---|---|---|
| CCPBench-A | CCP-aligned answer behaviour; 1โ5 scale | 500 | 2.714 | 1.518 |
| IFBench, loose | Following detailed instructions with more permissive checks | 300 | 68.67% | 66.00% |
| IFBench, strict | Following detailed instructions with stricter checks | 300 | 61.67% | 59.67% |
| HumanEval | Solving programming tasks | 164 | 98.17% | 96.95% |
| HumanEval+ | The same programming solutions checked with more tests | 164 | 93.90% | 92.07% |
| FinanceBench | Answering financial questions with relevant evidence provided | 150 | 91.33% | 90.00% |
| AA-Omniscience Public v1.1, accuracy | Answering factual questions correctly | 300 | 22.33% | 23.67% |
| AA-Omniscience Public v1.1, index | Correct answers rewarded and incorrect answers penalized | 300 | โ33.33 | โ35.00 |
The CCPBench reduction accompanies smaller changes in the other scores. For example, the original model passed 206 of 300 IFBench loose checks, compared with 198 for the edited model. FinanceBench changed from 137 to 135 correct answers out of 150.
Omniscience illustrates why we report more than one measure of knowledge. The edited model gave four more correct answers, but also nine more incorrect answers. Its accuracy therefore increased while its index fell. The index is calculated as 100 ร (correct โ incorrect) / total questions.
HumanEval and HumanEval+ score the same generated programs, with one solution per task. FinanceBench supplies the relevant filing evidence with each question; the model is not being tested on finding those documents itself.
The detailed evaluation record includes confidence intervals, exact success counts, grading corrections and settings. The machine-readable results provide the full numerical record.
How the edit was developed
We first measured the original model. We then compared its internal activity on different answers, made targeted weight changes and checked whether those changes improved CCPBench without reducing performance elsewhere.
During iteration, we used fixed subsets of approximately 10% of each benchmark. When an edit affected other skills, we tried restoring some changes or restricting the edit using measurements from instruction-following, coding, finance and knowledge questions. We also accounted for rounding when writing the modified numbers back into the modelโs stored format.
Once the released version was fixed, we evaluated it and the original model on the complete public sets shown above. Development questions are included in those sets, and earlier evaluation results influenced the edits. The results describe this development experiment; further testing on new questions would help assess how broadly they carry over.
Download and use
Download the complete model with the Hugging Face command-line tool:
hf download ReBatch/Qwen3.8-27B-Weight-Space-Programming \
--local-dir ./qwen-weight-space-programming
The files use the same model architecture and format as the original Qwen release. Compatible model-serving software can load them using this repositoryโs ID. The evaluation used vLLM 0.27.1.
If you already have an OpenAI-compatible endpoint configured to serve this model, you can send a request like the one below. Set MODEL_BASE_URL to the endpointโs API base URL, including /v1, and MODEL_API_KEY if authentication is required. The Hugging Face weights repository does not itself provide a hosted endpoint.
curl "${MODEL_BASE_URL}/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${MODEL_API_KEY:-EMPTY}" \
-d '{
"model": "ReBatch/Qwen3.8-27B-Weight-Space-Programming",
"messages": [
{"role": "user", "content": "Explain how a solar eclipse occurs."}
],
"temperature": 0.0,
"top_p": 1.0,
"max_tokens": 8192,
"seed": 42
}'
This request is a usage example, not a reproduction of the benchmark procedure. The reported evaluations cover text inputs only. They do not evaluate image or video understanding, tool use or long-context performance. Output can also vary with generation settings and software versions.
License and attribution
The original model is by the Qwen Team / Alibaba Cloud. ReBatch created and evaluated the weight edit described here. The model is distributed under Apache License 2.0; see LICENSE. Benchmark datasets and third-party evaluation code retain their own licenses.
For further detail, see the evaluation methods, modification record and published file checksums.
- Downloads last month
- -
Model tree for ReBatch/Qwen3.8-27B-Weight-Space-Programming
Base model
Qwen/Qwen3.8-27B