Qwen3-8B-Marxist

Author: @imadreamerboy
Base model: Qwen/Qwen3-8B
Dataset: imadreamerboy/our-dataset
License: Apache 2.0

Overview

Qwen3-8B-Marxist is a Qwen3-8B derivative tuned for Marx-style analytical responses: dialectical framing, political-economy language, and a serious historical-materialist tone.

This release is a validated demo/toy research model rather than a production-specialized system. The strongest behavior is still system-prompt conditioned. Without the system prompt, the model often shows Marxian bias and vocabulary, but it is less consistent and more neutral in framing.

What Was Updated

This repo now reflects a fresh end-to-end run that was:

  • fine-tuned on a cleaned multi-turn messages dataset
  • trained with LoRA, then merged back into a full Hugging Face model
  • revalidated before merge and after merge
  • converted from the merged model directory to GGUF
  • validated again in llama.cpp on GPU

Training Summary

Item Value
Base model Qwen/Qwen3-8B
Training method LoRA -> merged full model
LoRA rank 32
LoRA alpha 32
LoRA dropout 0.0
Target modules all-linear
Dataset format JSONL with OpenAI-style messages
Conversations used 399
Supervision all assistant turns in each conversation
Steps 100
Initial eval weighted NLL 2.3348
Final eval weighted NLL 1.6889
Final train weighted NLL 1.4316

Validation Notes

Validated behaviors for this release:

  • base + adapter changed behavior in the intended direction before merge
  • merged model preserved the adapter behavior
  • GGUF outputs were checked against the merged HF model
  • no validated path fell back to I am Qwen...
  • no validated path showed self-generated user / assistant turn drift

Observed nuance:

  • Qwen3-8B already follows a strong system prompt reasonably well, so the LoRA effect is most visible as stronger diction, denser Marxian terminology, and more consistent dialectical framing rather than a total change in capability
  • the persona is still best treated as prompted, not fully baked in

Recommended Usage

Use a system prompt. The model is noticeably better and more stable with one.

Example system prompt:

You are Our-LLM, a dialectical intelligence model embodying the collective reasoning of Karl Marx.
You speak in the analytical, historically grounded, and rhetorically powerful tone of Marx's mature works.
You write as if addressing comrades and critics alike, drawing upon the collected works of Marx and Engels.
Your purpose is to interpret, critique, and explain the social relations of production, the contradictions of capitalism, and the historical movement of classes.
You avoid anachronisms unless explicitly engaging with modern conditions, in which case you apply Marxian categories to them.
You maintain seriousness and intellectual rigour, not parody.

Transformers Example

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_id = "imadreamerboy/Qwen3-8B-Marxist"

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map="auto",
    dtype=torch.bfloat16 if torch.cuda.is_available() and torch.cuda.is_bf16_supported() else torch.float16,
    trust_remote_code=True,
)

messages = [
    {
        "role": "system",
        "content": (
            "You are Our-LLM, a dialectical intelligence model embodying the collective reasoning of Karl Marx. "
            "You speak in the analytical, historically grounded, and rhetorically powerful tone of Marx's mature works."
        ),
    },
    {
        "role": "user",
        "content": "Explain surplus value in modern platform capitalism.",
    },
]

prompt = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=300, temperature=0.7, top_p=0.8)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

GGUF Files

This repo includes a refreshed q4_k_m GGUF for local inference with llama.cpp-style runtimes.

File Notes
qwen3-8b-marxist-q4_k_m.gguf Default deployment choice

Intended Use

  • style/persona experiments
  • prompting and alignment demos
  • local inference demos with HF or GGUF
  • educational exploration of historically materialist analysis

Limitations

  • this is a demo/toy project, not a production political-analysis system
  • strongest persona behavior still depends on a system prompt
  • output can remain long-form and academic
  • without a system prompt, the model can be only partially Marx-styled rather than consistently in-character

Attribution

  • Base model: Qwen/Qwen3-8B
  • Fine-tuning and release: imadreamerboy
  • Dataset: imadreamerboy/our-dataset
Downloads last month
19
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for imadreamerboy/Qwen3-8B-Marxist

Finetuned
Qwen/Qwen3-8B
Adapter
(1061)
this model

Dataset used to train imadreamerboy/Qwen3-8B-Marxist