πŸ₯· LoRA Adapter (PyTorch PEFT) β€” Llama 3.2 3B Instruct (Ninjutsu Coaching)

License: Llama 3.2 Framework: PEFT / PyTorch Engine: llm-goalie Model Size: 27.8MB Base Model Live Demo

A standard PyTorch PEFT low-rank adapter (LoRA) fine-tuned on Llama-3.2-3B-Instruct. Specialized for direct, actionable coaching in skill acquisition, distilled from the principles in Modern Applications of Ninjutsu.


πŸ“Œ Model Selection: Which Version Should You Use?

Model Version Repository Format Best For
πŸ“¦ PyTorch PEFT Adapter (This Repo) itslenoid/llama3.2-3b-ninjutsu-peft PEFT / PyTorch (~27.8 MB) Linux / CUDA / Cloud. Standard Hugging Face Transformers & PEFT workflows.
⚑ Standalone Fused (Apple Silicon) itslenoid/llama3.2-3b-ninjutsu-fused MLX 4-bit (~1.8 GB) Mac (M1/M2/M3/M4). Instant 1-click standalone model on Apple Silicon using mlx-lm.
πŸ“¦ MLX LoRA Adapter itslenoid/llama3.2-3b-ninjutsu MLX (~27.8 MB) Mac (Apple Silicon). Native MLX adapter for mlx-community/Llama-3.2-3B-Instruct-4bit.
πŸš€ Interactive Web Demo itslenoid/llama3.2-3b-ninjutsu-demo Gradio / ZeroGPU Web Browser. Try the model instantly without any local setup.

🎯 What This Model Does

Standard language models often respond to skill and coaching questions with generic advice, disclaimers, and conversational filler. This fine-tune acts as a deliberate practice coach:

  • Direct & Actionable: Tells you what physical or mental adjustments to execute, step-by-step.
  • Progressive Pedagogy: Scaffolds complex movements or skills into digestible sub-skills and constraints.
  • Root-Cause Diagnostics: Identifies mechanical and perceptual errors rather than merely repeating basic form tips.
  • Zero Hedging: Authoritative, concise tone focused on performance feedback and deliberate repetition.

πŸ’‘ Recommended Coaching Prompts

  1. "Break down a 15-minute deliberate practice session for developing hip drive in rotational strikes."
  2. "I keep losing balance during rapid direction changes on uneven ground. Diagnose my mechanical error."
  3. "Design a 3-stage progressive overload constraint drill for handling high-pressure sparring."
  4. "How do I structure skill acquisition for a completely new motor pattern without ingraining bad habits?"

πŸš€ Quick Start (PyTorch / Transformers / PEFT)

1. Installation

pip install torch transformers peft accelerate

2. Python Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_id = "meta-llama/Llama-3.2-3B-Instruct"
adapter_id = "itslenoid/llama3.2-3b-ninjutsu-peft"

# 1. Load tokenizer and base model
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

# 2. Attach Ninjutsu Coaching PEFT adapter
model = PeftModel.from_pretrained(base_model, adapter_id)
model.eval()

# 3. Format prompt using chat template
messages = [
    {"role": "system", "content": "You are an expert martial arts and skill acquisition coach. Provide direct, actionable, and structured guidance without conversational hedging or filler."},
    {"role": "user", "content": "How do I learn a new technique efficiently?"}
]
input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)

# 4. Generate
with torch.no_grad():
    outputs = model.generate(
        input_ids,
        max_new_tokens=512,
        temperature=0.7,
        top_p=0.9,
    )
response = tokenizer.decode(outputs[0][input_ids.shape[1]:], skip_special_tokens=True)
print(response)

πŸ“Š Training & Technical Details

Parameter Value
Base Architecture Llama 3.2 3B Instruct
Base Model Weights meta-llama/Llama-3.2-3B-Instruct
Adapter Type LoRA (PEFT)
LoRA Rank 8
LoRA Scale 20.0
Tuned Layers 16 / 28 (layers 12 through 27)
Target Modules q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Dropout 0.0
Best Validation Loss 2.540
Perplexity (PPL) 19.05 β†’ 12.68 (~33% relative improvement)

πŸ₯… Defensive Training & Evaluation with llm-goalie

This model was trained, tuned, and evaluated using llm-goalie, an open-source defensive fine-tuning and evaluation engine for Apple Silicon.

llm-goalie ran automated hyperparameter tournament sweeps with active early stopping to prevent overfitting, rigorously triangulating model quality against held-out perplexity (improving from 19.05 β†’ 12.68), catastrophic forgetting benchmarks, and strict rule-based control gates. To reproduce these results or fine-tune your own domain models locally, visit the project-kingmaker/llm-goalie repository.


πŸ“š About the Project & Source Material

This adapter distills pedagogical principles from Modern Applications of Ninjutsu, a treatise on progressive skill acquisition, motor learning, constraint-led training, and martial arts pedagogy.

The training dataset transforms the book's frameworks on deliberate practice, neuromuscular adaptation, and physical discipline into instruction-following weights, producing an assistant capable of diagnosing mechanical breakdowns and prescribing structured drills.


πŸ“„ License

This adapter inherits the Meta Llama 3.2 Community License from the base model.

Downloads last month
57
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for itslenoid/llama3.2-3b-ninjutsu-peft

Adapter
(901)
this model

Space using itslenoid/llama3.2-3b-ninjutsu-peft 1

Collection including itslenoid/llama3.2-3b-ninjutsu-peft