Text Generation
Transformers
Safetensors
English
llama
dense-responses
self-improvement
representation-engineering
cf-hot
recursive-self-improvement
conversational
text-generation-inference
Instructions to use LoganResearch/ARC-Base-8B-Condensed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LoganResearch/ARC-Base-8B-Condensed with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LoganResearch/ARC-Base-8B-Condensed") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LoganResearch/ARC-Base-8B-Condensed") model = AutoModelForCausalLM.from_pretrained("LoganResearch/ARC-Base-8B-Condensed", device_map="auto") 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 LoganResearch/ARC-Base-8B-Condensed with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LoganResearch/ARC-Base-8B-Condensed" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LoganResearch/ARC-Base-8B-Condensed", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LoganResearch/ARC-Base-8B-Condensed
- SGLang
How to use LoganResearch/ARC-Base-8B-Condensed 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 "LoganResearch/ARC-Base-8B-Condensed" \ --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": "LoganResearch/ARC-Base-8B-Condensed", "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 "LoganResearch/ARC-Base-8B-Condensed" \ --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": "LoganResearch/ARC-Base-8B-Condensed", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LoganResearch/ARC-Base-8B-Condensed with Docker Model Runner:
docker model run hf.co/LoganResearch/ARC-Base-8B-Condensed
| """ | |
| ARC Inference - Dense output with CF-HoT steering | |
| """ | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| from peft import PeftModel | |
| import torch.nn.functional as F | |
| # Load model | |
| print("Loading base model...") | |
| base = AutoModelForCausalLM.from_pretrained( | |
| "NousResearch/Hermes-3-Llama-3.1-8B", | |
| torch_dtype=torch.float16, | |
| device_map="auto", | |
| load_in_4bit=True | |
| ) | |
| print("Loading ARC adapter...") | |
| model = PeftModel.from_pretrained( | |
| base, | |
| "LoganResearch/ARC-Base-8B-Condensed", | |
| subfolder="dense_checkpoints/step_100" | |
| ) | |
| tokenizer = AutoTokenizer.from_pretrained("NousResearch/Hermes-3-Llama-3.1-8B") | |
| # Load CF-HoT risk predictor | |
| print("Loading CF-HoT head...") | |
| from huggingface_hub import hf_hub_download | |
| risk_path = hf_hub_download( | |
| "LoganResearch/ARC-Base-8B-Condensed", | |
| "cfhot_checkpoints/ckpt_5000/risk_predictor.pt" | |
| ) | |
| cfhot_state = torch.load(risk_path, map_location="cuda", weights_only=False) | |
| # Simple CF-HoT steering tokens | |
| REPETITION_TOKENS = [tokenizer.encode(w, add_special_tokens=False)[0] | |
| for w in ["the", "is", "that", "this", "and", "to", "of"]] | |
| HEDGING_TOKENS = [tokenizer.encode(w, add_special_tokens=False)[0] | |
| for w in ["great", "happy", "certainly", "definitely", "really"]] | |
| def generate_dense(prompt: str, max_tokens: int = 50) -> str: | |
| """Generate with CF-HoT logit steering.""" | |
| full_prompt = f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n" | |
| input_ids = tokenizer(full_prompt, return_tensors="pt").input_ids.to("cuda") | |
| generated = input_ids.clone() | |
| for _ in range(max_tokens): | |
| with torch.no_grad(): | |
| outputs = model(generated) | |
| logits = outputs.logits[:, -1, :] / 0.7 | |
| # CF-HoT steering: penalize hedging/filler tokens | |
| for tok_id in HEDGING_TOKENS: | |
| logits[0, tok_id] -= 4.0 | |
| # Sample | |
| probs = F.softmax(logits, dim=-1) | |
| next_token = torch.multinomial(probs, 1) | |
| generated = torch.cat([generated, next_token], dim=1) | |
| if next_token.item() == tokenizer.eos_token_id: | |
| break | |
| response = tokenizer.decode(generated[0], skip_special_tokens=True) | |
| return response.split("assistant")[-1].strip() | |
| if __name__ == "__main__": | |
| while True: | |
| prompt = input("\nYou: ") | |
| if prompt.lower() in ["quit", "exit"]: | |
| break | |
| response = generate_dense(prompt) | |
| print(f"ARC: {response}") | |