Downloads Β· 30 days
15
24% of all-time downloads
LoganResearch/Adaptive-Repetition-Controller-ARC
Adaptive-Repetition-Controller-ARC is a text generation model from LoganResearch. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Downloads Β· 30 days
15
24% of all-time downloads
All-time downloads
63
Public
Repo size
244 MB
Likes
3
Public
Click a slice to open those files.
.safetensors218 MB Β· 84%
From the Hugging Face model README
A learned system that predicts and prevents repetitive degeneration in language models.
Base Model | GitHub | Paper (forthcoming)
</div>Autoregressive language models suffer from repetitive degeneration β the tendency to fall into loops, repeat phrases, or get stuck on patterns during long-form generation.
Standard solutions apply uniform penalties to repeated tokens. But repetition isn't always bad, and uniform penalties can't distinguish between:
The Adaptive Repetition Controller learns to predict when repetition is about to become problematic, then applies targeted intervention only when needed.
<div align="center">βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GENERATION PIPELINE β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β β
β Input βββΆ Base Model βββΆ Hidden States (32 layers) β
β β β
β βΌ β
β βββββββββββββββββββ β
β β Risk Predictor β β
β β (50K params) β β
β ββββββββββ¬βββββββββ β
β β β
β βΌ β
β risk = 0.95 (HIGH) β
β β β
β βΌ β
β logits[recent_tokens] -= penalty β
β β β
β βΌ β
β Sample next token β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
</div>
The system achieves 125x separation between tokens that will repeat and those that won't:
| Metric | Value |
|---|---|
| F1 Score | 0.99+ |
| Risk @ Repeating Tokens | 0.998 |
| Risk @ Non-Repeating Tokens | 0.008 |
| Separation Factor | 125x |
| Metric | Baseline | With CF-HoT | Change |
|---|---|---|---|
| Repetition Rate | 33.9% | 17.5% | β 48.4% |
| Distinct-2 (diversity) | 0.836 | 0.976 | β 16.7% |
| Method | Adaptive | Learned | Repetition Reduction |
|---|---|---|---|
HuggingFace repetition_penalty | β | β | ~20-30% |
OpenAI frequency_penalty | β | β | ~25-35% |
| Contrastive Decoding | β | β | ~30-40% |
| CF-HoT (this) | β | β | 48.4% |
The risk predictor is remarkably small β only ~50,000 parameters (0.0006% of the base model):
RiskPredictor(
# Extract features from each transformer layer
fiber_projs = ModuleList([
Linear(4096 β 16) for _ in range(32) # 32 layers
]),
# Learn which layers matter most
layer_weights = Parameter(shape=[32]), # Softmax-normalized
# Predict repetition risk
predictor = Sequential(
Linear(16 β 64),
GELU(),
Linear(64 β 64),
GELU(),
Linear(64 β 1), # Risk logit
)
)
pip install transformers peft accelerate torch
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"LoganResearch/ARC-Base-8B",
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("LoganResearch/ARC-Base-8B")
# Load CF-HoT adapter
model = PeftModel.from_pretrained(
base_model,
"LoganResearch/Adaptive-Repetition-Controller"
)
# Load risk predictor
risk_predictor = torch.load(
hf_hub_download("LoganResearch/Adaptive-Repetition-Controller", "risk_predictor.pt")
)
def generate_with_cfhot(
prompt: str,
max_tokens: int = 512,
penalty_scale: float = 3.0,
threshold: float = 0.1,
temperature: float = 0.8,
rep_window: int = 32,
):
"""Generate text with adaptive repetition suppression."""
input_ids = tokenizer.encode(prompt, return_tensors="pt").to(model.device)
for _ in range(max_tokens):
with torch.no_grad():
# Forward pass with hidden states
outputs = model(input_ids, output_hidden_states=True)
logits = outputs.logits[:, -1, :]
hidden_states = outputs.hidden_states
# Predict repetition risk
risk = risk_predictor(hidden_states).sigmoid().item()
# Apply adaptive penalty if risk is high
if risk > threshold:
recent_tokens = input_ids[0, -rep_window:].tolist()
penalty = risk * penalty_scale
for token_id in set(recent_tokens):
logits[0, token_id] -= penalty
# Sample next token
probs = torch.softmax(logits / temperature, dim=-1)
next_token = torch.multinomial(probs, num_samples=1)
# Append and check for EOS
input_ids = torch.cat([input_ids, next_token], dim=-1)
if next_token.item() == tokenizer.eos_token_id:
break
return tokenizer.decode(input_ids[0], skip_special_tokens=True)
# Example usage
response = generate_with_cfhot(
"Write a detailed essay on the nature of consciousness:",
max_tokens=1000,
penalty_scale=4.0,
)
print(response)
| File | Size | Description |
|---|---|---|
risk_predictor.pt | 8.4 MB | Trained risk prediction network |
adapter_model.safetensors | 218 MB | LoRA adapter weights |
adapter_config.json | 1 KB | PEFT adapter configuration |
| Parameter | Value |
|---|---|
d_fiber | 16 |
d_control | 64 |
rep_window | 32 |
lr_predictor | 1e-4 |
lr_lora | 2e-5 |
batch_size | 4 |
gradient_accumulation | 8 |
optimal_checkpoint | Step 5000 |
| Step | F1 | Risk @ Reps | Risk @ Non-Reps | Separation |
|---|---|---|---|---|
| 3000 | 0.96 | 0.946 | 0.076 | 12x |
| 4000 | 0.99 | 0.997 | 0.014 | 71x |
| 5000 | 0.99+ | 0.998 | 0.008 | 125x β |
| 6000 | 0.99+ | 0.999 | 0.021 | 48x |
Step 5000 is optimal β further training reduces separation due to overfitting.
This system emerged from research into geometric approaches to semantic consistency. The original theory proposed using fiber bundles and holonomy to detect inconsistency in transformer representations.
What we tried:
What worked:
@misc{napolitano2026arc,
author = {Napolitano, Logan Matthew},
title = {Adaptive Repetition Controller: Learned Decode-Time Intervention
for Repetition Suppression},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/LoganResearch/Adaptive-Repetition-Controller}},
}
| Resource | Link |
|---|---|
| Base Model | LoganResearch/ARC-Base-8B |
| Source Code | GitHub: HolonomyTransformer |
| Paper | "The Γbermensch Who Cannot Loop" (forthcoming) |
| Author | Logan Matthew Napolitano |
The Γbermensch who cannot loop is forced to CREATE.
Built with determination by Logan Matthew Napolitano
</div>