Instructions to use cs-552-2026-momy/general_knowledge_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cs-552-2026-momy/general_knowledge_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cs-552-2026-momy/general_knowledge_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cs-552-2026-momy/general_knowledge_model") model = AutoModelForCausalLM.from_pretrained("cs-552-2026-momy/general_knowledge_model") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cs-552-2026-momy/general_knowledge_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cs-552-2026-momy/general_knowledge_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cs-552-2026-momy/general_knowledge_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cs-552-2026-momy/general_knowledge_model
- SGLang
How to use cs-552-2026-momy/general_knowledge_model 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 "cs-552-2026-momy/general_knowledge_model" \ --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": "cs-552-2026-momy/general_knowledge_model", "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 "cs-552-2026-momy/general_knowledge_model" \ --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": "cs-552-2026-momy/general_knowledge_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cs-552-2026-momy/general_knowledge_model with Docker Model Runner:
docker model run hf.co/cs-552-2026-momy/general_knowledge_model
General Knowledge Model — CS-552 (MOMY)
A reasoning-focused model for general-knowledge question answering, post-trained from
Qwen/Qwen3-1.7B using GRPO (Group Relative
Policy Optimization) with verifiable rewards (RLVR). Developed for the EPFL CS-552 Modern NLP
course project (Spring 2026).
The model reasons step-by-step inside <think>...</think> tags before producing a final answer
enclosed in a \boxed{} environment, supporting automated answer extraction and verification.
Model Details
- Base model: Qwen3-1.7B
- Training method: GRPO (RLVR) with LoRA (r=16, α=32) adapters merged into base weights
- Domain: General knowledge — science, history, geography, world affairs
- Output format:
<think>reasoning chain followed by\boxed{ANSWER} - Team: MOMY
Intended Use
The model answers both multiple-choice and short open-ended factual questions:
- Multiple-choice: outputs the correct option letter, e.g.
\boxed{B} - Open-ended: outputs a short factual answer, e.g.
\boxed{Paris}
Training Data
| Source | Type | Share |
|---|---|---|
| MMLU-Pro | Graduate-level multiple-choice (up to 10 options) | ~7k |
| TriviaQA | Open-domain factual QA | ~2k |
A total of 8,100 training and 900 validation examples (90/10 split), each formatted with a
chain-of-thought target terminating in Therefore, the final answer is \boxed{·}.
Training Configuration
| Hyperparameter | Value |
|---|---|
| Method | GRPO (RLVR) |
| Learning rate | 1e-4 |
| Effective batch size | 16 |
| Rollouts per prompt | 4 |
| Training steps | 300 |
| Temperature (rollout) | 0.9 |
| KL coefficient (β) | 0.04 |
| LoRA rank / alpha | 16 / 32 |
| Hardware | 1× NVIDIA A100-40G |
Reward function: +1.0 for a correct boxed answer, +0.1 for a valid <think> block,
-0.1 for a missing/malformed box, -0.1 for exceeding the token budget.
Evaluation
| Benchmark | pass@1 |
|---|---|
| Course CI (knowledge) | 0.44 |
| Qwen3-1.7B base (CI) | 0.25 |
| Local held-out (n=900) | 0.373 (pass@8: 0.492) |
GRPO substantially improves over the base model on the held-out CI knowledge benchmark.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "cs-552-2026-momy/general_knowledge_model"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": "What is the capital of Australia?"}]
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=2048, temperature=0.6, top_p=0.95, top_k=20)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
The chat template hardcodes enable_thinking=true, so the model always reasons before answering.
A generation_config.json with the recommended inference parameters is included in the repo.
Limitations
- As a 1.7B-parameter model, factual coverage is limited; performance on long-tail or highly specialized knowledge is unreliable.
- The dominant failure mode is option-matching miscalibration: the model may derive a correct value in its reasoning but select a mismatched option when the computed answer is not listed among the choices.
- Knowledge is skewed toward English-language and Western-centric sources (MMLU-Pro, TriviaQA).
Citation
If referencing this model, please cite the underlying methods:
- GRPO: Shao et al., DeepSeekMath (2024)
- MMLU-Pro: Wang et al. (2024)
- TriviaQA: Joshi et al. (2017)
- Base model: Qwen3-1.7B (Qwen Team, 2025)
- Downloads last month
- 443