Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,133 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
-
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
|
| 8 |
-
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
## Model
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
-
|
| 21 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 22 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
-
- **Model type:** [More Information Needed]
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
-
##
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
##
|
| 41 |
|
| 42 |
-
|
|
|
|
| 43 |
|
| 44 |
-
|
|
|
|
| 45 |
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
-
|
| 57 |
|
| 58 |
-
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
-
##
|
| 65 |
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
[More Information Needed]
|
| 75 |
-
|
| 76 |
-
## Training Details
|
| 77 |
-
|
| 78 |
-
### Training Data
|
| 79 |
-
|
| 80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
-
|
| 84 |
-
### Training Procedure
|
| 85 |
-
|
| 86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 87 |
-
|
| 88 |
-
#### Preprocessing [optional]
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
-
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
-
|
| 99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 100 |
-
|
| 101 |
-
[More Information Needed]
|
| 102 |
-
|
| 103 |
-
## Evaluation
|
| 104 |
-
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
-
|
| 107 |
-
### Testing Data, Factors & Metrics
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
## Environmental Impact
|
| 142 |
-
|
| 143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
## Model Card Authors [optional]
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Model Card Contact
|
| 198 |
|
| 199 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- tactical-reasoning
|
| 7 |
+
- military
|
| 8 |
+
- defense-ai
|
| 9 |
+
- bicell-dispersal
|
| 10 |
+
- sft
|
| 11 |
+
- dual-perspective
|
| 12 |
+
- shepherd
|
| 13 |
+
base_model: Qwen/Qwen3-1.7B
|
| 14 |
+
datasets:
|
| 15 |
+
- ZennyKenny/tactical-military-reasoning-v.1.0
|
| 16 |
library_name: transformers
|
| 17 |
+
pipeline_tag: text-generation
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# Shepherd-Alpha
|
| 21 |
|
| 22 |
+
**The first defense AI reasoning model on Hugging Face.**
|
| 23 |
|
| 24 |
+
Shepherd-Alpha is a tactical reasoning model fine-tuned on dual-perspective military scenario analysis using BiCell Depth Dispersal β a novel training methodology that partitions transformer layers by abstraction depth and trains them asymmetrically to separate representation encoding from task-specific reasoning.
|
| 25 |
|
| 26 |
+
Developed by [Convergent Intelligence LLC: Research Division](https://convergentintel.com)
|
| 27 |
|
| 28 |
+
## What This Model Does
|
| 29 |
|
| 30 |
+
Given a tactical scenario, Shepherd-Alpha produces structured dual-perspective analysis:
|
| 31 |
+
- **Attack reasoning** β how an adversary would exploit the situation
|
| 32 |
+
- **Defense reasoning** β how to counter, mitigate, and survive
|
| 33 |
|
| 34 |
+
The model is trained to think like both attacker and defender simultaneously. A model that understands how to attack becomes a defender that anticipates.
|
| 35 |
|
| 36 |
+
## Training Methodology: BiCell Depth Dispersal
|
| 37 |
|
| 38 |
+
Standard fine-tuning updates all layers jointly, allowing co-adaptation that can mask shallow learning. BiCell Depth Dispersal forces genuine specialization:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
+
| Phase | Frozen | Training | Purpose |
|
| 41 |
+
|-------|--------|----------|---------|
|
| 42 |
+
| 1 | Upper layers (14-27) | Lower layers (0-13) | Foundations encode before specialization exists |
|
| 43 |
+
| 2 | Lower layers (0-13) | Upper layers (14-27) | Reasoning learns over frozen representations |
|
| 44 |
+
| 3 | None | All layers | Joint integration of asymmetric gradient history |
|
| 45 |
|
| 46 |
+
All three backward passes accumulate gradients before a single optimizer step. The asymmetric gradient history forces each depth zone to develop independently before integration.
|
| 47 |
|
| 48 |
+
**Key finding during training:** Lower layers consistently produce ~1.7x the gradient magnitude of upper layers during domain adaptation. The pretrained upper layers already possess sufficient reasoning capacity β the primary adaptation is teaching lower layers to encode tactical domain structure. This suggests that for domain-specific SFT, representation layers (not reasoning layers) are the bottleneck.
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
### Training Details
|
| 51 |
|
| 52 |
+
- **Base model:** Qwen/Qwen3-1.7B (28 layers, all full attention)
|
| 53 |
+
- **Dataset:** [ZennyKenny/tactical-military-reasoning-v.1.0](https://huggingface.co/datasets/ZennyKenny/tactical-military-reasoning-v.1.0) β 150 dual-perspective tactical scenarios with attack and defense chain-of-thought reasoning (MIT licensed)
|
| 54 |
+
- **Architecture:** 28 transformer layers split at depth 14 β Zone Lo (layers 0-13) and Zone Hi (layers 14-27)
|
| 55 |
+
- **Hardware:** NVIDIA A100
|
| 56 |
+
- **Epochs:** 3
|
| 57 |
+
- **Batch size:** 2
|
| 58 |
+
- **Learning rate:** 2e-5 (AdamW, weight decay 0.01)
|
| 59 |
+
- **Precision:** bfloat16
|
| 60 |
+
- **Label masking:** Loss computed only on assistant (reasoning) tokens, not scenario prompts
|
| 61 |
|
| 62 |
+
## Usage
|
| 63 |
|
| 64 |
+
```python
|
| 65 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 66 |
|
| 67 |
+
model = AutoModelForCausalLM.from_pretrained("reaperdoesntknow/Shepherd-Alpha")
|
| 68 |
+
tokenizer = AutoTokenizer.from_pretrained("reaperdoesntknow/Shepherd-Alpha")
|
| 69 |
|
| 70 |
+
messages = [
|
| 71 |
+
{
|
| 72 |
+
"role": "user",
|
| 73 |
+
"content": "Analyze this tactical scenario.\n\nScenario: A mechanized platoon advancing through urban terrain detects a coordinated drone swarm from the northeast. Limited anti-air capability. Civilian structures restrict fields of fire."
|
| 74 |
+
}
|
| 75 |
+
]
|
| 76 |
|
| 77 |
+
inputs = tokenizer.apply_chat_template(
|
| 78 |
+
messages,
|
| 79 |
+
add_generation_prompt=True,
|
| 80 |
+
tokenize=True,
|
| 81 |
+
return_dict=True,
|
| 82 |
+
return_tensors="pt",
|
| 83 |
+
)
|
| 84 |
|
| 85 |
+
output = model.generate(
|
| 86 |
+
**inputs,
|
| 87 |
+
max_new_tokens=512,
|
| 88 |
+
temperature=0.7,
|
| 89 |
+
top_p=0.9,
|
| 90 |
+
do_sample=True,
|
| 91 |
+
)
|
| 92 |
|
| 93 |
+
generated = output[0][inputs["input_ids"].shape[1]:]
|
| 94 |
+
print(tokenizer.decode(generated, skip_special_tokens=True))
|
| 95 |
+
```
|
| 96 |
|
| 97 |
+
## The Shepherd Program
|
| 98 |
|
| 99 |
+
Shepherd-Alpha is the first public model in the Shepherd family β an ongoing research program developing AI systems for autonomous defense applications. The program spans:
|
| 100 |
|
| 101 |
+
- **Shepherd Doctrine** β a comprehensive counter-swarm and area defense blueprint covering 28+ subsystems across five concentric engagement layers
|
| 102 |
+
- **Shepherd AI** β tactical reasoning models trained on dual-perspective analysis (this model)
|
| 103 |
+
- **BiCell Dispersal** β a training methodology based on the B_i Cell Dispersal framework for stochastic layer partitioning during fine-tuning
|
| 104 |
|
| 105 |
+
## Limitations
|
| 106 |
|
| 107 |
+
- **Alpha release** β this is a research checkpoint, not a production system
|
| 108 |
+
- **Small training set** β 150 scenarios provides format and domain grounding but limited tactical depth. Future versions will incorporate augmented datasets with multi-model generated reasoning
|
| 109 |
+
- **Base model thinking mode** β Qwen3's pretrained `<think>` generation pattern can override the structured output format. Use `enable_thinking=False` in generation config for cleaner output
|
| 110 |
+
- **Not a weapon system** β this model performs analysis and reasoning. It does not control, target, or actuate anything
|
| 111 |
|
| 112 |
+
## Citation
|
| 113 |
|
| 114 |
+
```bibtex
|
| 115 |
+
@misc{shepherd-alpha-2026,
|
| 116 |
+
title={Shepherd-Alpha: Tactical Reasoning via BiCell Depth Dispersal},
|
| 117 |
+
author={Convergent Intelligence LLC},
|
| 118 |
+
year={2026},
|
| 119 |
+
url={https://huggingface.co/reaperdoesntknow/Shepherd-Alpha}
|
| 120 |
+
}
|
| 121 |
+
```
|
| 122 |
|
| 123 |
+
## Related Work
|
| 124 |
|
| 125 |
+
- [Structure Over Scale](https://doi.org/10.57967/hf/5165) β Foundation paper on structure-first training methodologies
|
| 126 |
+
- [DualMind Methodology](https://doi.org/10.57967/hf/5184) β Dual-cognitive-mode SFT using EXPLORE/EXAMINE tokens
|
| 127 |
+
- [Discrepancy Calculus](https://doi.org/10.57967/hf/5194) β Mathematical framework grounding BiCell dispersal theory
|
| 128 |
+
- [B_i Cell Dispersal Framework](https://convergentintel.com) β Stochastic layer freezing grounded in DISC measure theory
|
| 129 |
|
| 130 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
+
*Convergent Intelligence LLC: Research Division*
|
| 133 |
+
*"Structure beats scale. Collaboration beats hierarchy. Observation beats theory."*
|