Text Generation
PEFT
Safetensors
Transformers
English
Chinese
text-generation-inference
unsloth
lora
fragmented-training
burden-based-learning
logic-restoration
agent
Instructions to use aifeifei798/Fragmented-Training with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use aifeifei798/Fragmented-Training with PEFT:
Task type is invalid.
- Transformers
How to use aifeifei798/Fragmented-Training with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aifeifei798/Fragmented-Training")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("aifeifei798/Fragmented-Training", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aifeifei798/Fragmented-Training with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aifeifei798/Fragmented-Training" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aifeifei798/Fragmented-Training", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aifeifei798/Fragmented-Training
- SGLang
How to use aifeifei798/Fragmented-Training 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 "aifeifei798/Fragmented-Training" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aifeifei798/Fragmented-Training", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "aifeifei798/Fragmented-Training" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aifeifei798/Fragmented-Training", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use aifeifei798/Fragmented-Training with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for aifeifei798/Fragmented-Training to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for aifeifei798/Fragmented-Training to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for aifeifei798/Fragmented-Training to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="aifeifei798/Fragmented-Training", max_seq_length=2048, ) - Docker Model Runner
How to use aifeifei798/Fragmented-Training with Docker Model Runner:
docker model run hf.co/aifeifei798/Fragmented-Training
Update README.md
Browse files
README.md
CHANGED
|
@@ -69,6 +69,79 @@ This model represents a fundamental shift in how we approach LLM fine-tuning. In
|
|
| 69 |
| **Reasoning Mode** | Linear Pattern Matching | **Global Semantic Reconstruction** | **Deep Logic** |
|
| 70 |
| **Zero-Shot Understanding**| Fails / Hallucinates | **Emergent Conceptual Synthesis** | **Self-Reflective** |
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
---
|
| 73 |
|
| 74 |
## 🔬 Mechanistic Verification: Residual Stream Vector Interference
|
|
|
|
| 69 |
| **Reasoning Mode** | Linear Pattern Matching | **Global Semantic Reconstruction** | **Deep Logic** |
|
| 70 |
| **Zero-Shot Understanding**| Fails / Hallucinates | **Emergent Conceptual Synthesis** | **Self-Reflective** |
|
| 71 |
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
## 📊 Logit Lens Audit: Active Vocabulary Collapse (Candidate Pruning)
|
| 76 |
+
|
| 77 |
+
> **"At Layer 29, the Base model hesitates across 72 candidate words—the FT model slashes this down to just 8 tokens."**
|
| 78 |
+
|
| 79 |
+
To measure *how* **Fragmented Training (FT)** eliminates off-target hesitation, we performed a layer-by-layer **Logit Lens audit**. By projecting the residual stream hidden state $h\_l$ at each layer through the unembedding head (`Final Norm + LM Head`), we calculated the number of **Active Candidate Tokens** (vocabulary tokens with probability $P > 0.1\%$).
|
| 80 |
+
|
| 81 |
+
---
|
| 82 |
+
|
| 83 |
+
### 📉 Empirical Evidence: The "Subtractive Pruning" Cliff
|
| 84 |
+
|
| 85 |
+
The layer-by-layer candidate count demonstrates a dramatic **Vocabulary Collapse** in the deep reasoning layers of the FT model:
|
| 86 |
+
|
| 87 |
+
```
|
| 88 |
+
[L-19 to L-21: Broad Search] ==> Assembles broad candidate associations (+6 to +9 tokens)
|
| 89 |
+
│
|
| 90 |
+
[L-22 to L-33: The Pruning Cliff] =======> Active candidate words plummet by up to -64 tokens!
|
| 91 |
+
│
|
| 92 |
+
[L-28 to L-32: Single-Digit Lock] =======> FT locks into 6–8 tokens (vs Base pondering 40–72 tokens)
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
#### 1. Candidate Assembly & Broad Search (L-19 to L-21)
|
| 96 |
+
* **Phenomenon:** The FT model briefly expands its candidate pool (+6 to +9 active words over Base).
|
| 97 |
+
* **Mechanism:** In middle layers, the model performs a **global semantic sweep**, assembling all potential contextual associations required to resolve the scrambled input.
|
| 98 |
+
|
| 99 |
+
#### 2. The Subtractive Pruning Cliff (L-22 to L-33)
|
| 100 |
+
* **Phenomenon:** A massive, sustained collapse in active candidate words.
|
| 101 |
+
* **Key Highlight (Layer 29):** The Base model remains indecisive with **72 active candidate words**. The FT model brutally prunes the search space down to **8 tokens**—an unprecedented drop of **`-64 candidate words` in a single layer**!
|
| 102 |
+
|
| 103 |
+
#### 3. Single-Digit Decision Lock (L-28 to L-32)
|
| 104 |
+
* **Phenomenon:** The FT model converges into single-digit candidate counts (6 to 8 tokens) 5 layers earlier than the Base model.
|
| 105 |
+
* **Mechanism:** By eliminating 80%–90% of off-target candidates by Layer 28, the softmax entropy collapses cleanly. This **Confidence Sharpening** directly explains why the FT model achieves a **29.61% speedup** in inference time.
|
| 106 |
+
|
| 107 |
+
---
|
| 108 |
+
|
| 109 |
+
### 📋 Active Vocabulary Count Comparison (Key Deep Layers)
|
| 110 |
+
|
| 111 |
+
| Layer | Base Active Tokens ($P > 0.1\%$) | **FT Active Tokens ($P > 0.1\%$)** | Token Difference (FT - Base) | Candidate Pruning Dynamics |
|
| 112 |
+
| :--- | :--- | :--- | :--- | :--- |
|
| 113 |
+
| **L-19** | `66` | **`72`** | `+6` | ⬆️ Candidate Assembly (Broad Search) |
|
| 114 |
+
| **L-22** | `99` | **`73`** | **`-26`** | ⬇️ Pruning Onset |
|
| 115 |
+
| **L-23** | `82` | **`47`** | **`-35`** | ⬇️ Subtractive Pruning |
|
| 116 |
+
| **L-27** | `57` | **`12`** | **`-45`** | ⬇️ Severe Vocabulary Collapse |
|
| 117 |
+
| **L-28** | `43` | **`7`** | **`-36`** | 🔒 **Single-Digit Lock (7 Tokens)** |
|
| 118 |
+
| **L-29** | `72` | **`8`** | **`-64`** | 💥 **Peak Collapse (-64 Tokens)** |
|
| 119 |
+
| **L-30** | `52` | **`15`** | **`-37`** | ⬇️ Sustained Compression |
|
| 120 |
+
| **L-31** | `36` | **`6`** | **`-30`** | 🔒 **Single-Digit Lock (6 Tokens)** |
|
| 121 |
+
| **L-32** | `41` | **`7`** | **`-34`** | 🔒 **Single-Digit Lock (7 Tokens)** |
|
| 122 |
+
| **L-33** | `15` | **`7`** | **`-8`** | 🚀 Ready for Sharp Output |
|
| 123 |
+
|
| 124 |
+
---
|
| 125 |
+
|
| 126 |
+
### 🛠️ Reproduce Active Word Counting Locally
|
| 127 |
+
|
| 128 |
+
Run our open-source Logit Lens script to verify active token counts across all 36 layers:
|
| 129 |
+
|
| 130 |
+
```bash
|
| 131 |
+
# Count active vocabulary tokens (P > 0.1%) layer by layer
|
| 132 |
+
python count_active_words.py
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
```python
|
| 136 |
+
# Core Logit Lens calculation in count_active_words.py:
|
| 137 |
+
norm_h = final_norm(h_l)
|
| 138 |
+
logits = lm_head(norm_h)
|
| 139 |
+
probs = F.softmax(logits, dim=-1)
|
| 140 |
+
|
| 141 |
+
# Count candidate words with probability > 0.1%
|
| 142 |
+
active_count = (probs > 0.001).sum().item()
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
---
|
| 146 |
|
| 147 |
## 🔬 Mechanistic Verification: Residual Stream Vector Interference
|