File size: 4,438 Bytes
bcd4a45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
license: cc-by-4.0
language:
  - pt
tags:
  - monotropic-model
  - small-language-model
  - structural-engineering
  - timoshenko-beam-theory
  - curriculum-learning
  - validated-synthetic-data
  - physics-informed-ai
  - mlx
  - apple-silicon
pipeline_tag: text-generation
library_name: mlx
---

# Mini-Enedina: A Domain-Specialized Small Language Model for Structural Shaft Analysis

**Mini-Enedina** is a monotropic language model -- deliberately small and intensively specialized -- with 37.5 million parameters, designed exclusively for structural shaft analysis according to Timoshenko beam theory.

## Model Details

| Parameter | Value |
|-----------|-------|
| **Parameters** | 37.57M |
| **Layers** | 7 |
| **Attention Heads** | 8 |
| **Model Dimension** | 512 |
| **Feed-Forward Dimension** | 2048 |
| **Vocabulary Size** | 8,012 (8,000 BPE + 12 Harmony tokens) |
| **Max Sequence Length** | 14,336 tokens |
| **Positional Encoding** | RoPE |
| **Normalization** | RMSNorm (pre-norm) |
| **Activation** | SiLU (SwiGLU) |
| **Framework** | MLX (Apple Silicon) |
| **Precision** | BFloat16 |
| **Model Size** | 143 MB |

## Training

- **Dataset:** 60,000 physically validated samples (621M tokens) of Timoshenko shaft analysis problems
- **Training Strategy:** Multidimensional curriculum learning with 4 phases (Foundation, Intermediate, Advanced, Full)
- **Three Analysis Levels:**
  - **Bachelor:** Deflection analysis (V, M, w, theta)
  - **Master:** + Von Mises stress analysis
  - **Doctor:** + Fatigue evaluation (Marin factors, Goodman criterion)
- **Hardware:** Apple M4 Pro, 48 GB unified memory
- **Training Time:** ~23 hours (14,920 steps)
- **Optimizer:** AdamW (lr=3e-4, cosine schedule with warmup)

## Evaluation Results (6,000 held-out test samples)

| Metric | Overall | Bachelor | Master | Doctor |
|--------|---------|----------|--------|--------|
| **Loss** | 0.0787 | 0.0733 | 0.0804 | 0.0825 |
| **Perplexity** | 1.08 | 1.08 | 1.08 | 1.09 |
| **Correct Stop Token** | 94% | 97% | 100% | 85% |
| **Valid Harmony Structure** | 100% | 100% | 100% | 100% |

## Output Format: Harmony-Enedina

The model generates structured responses using the Harmony-Enedina format with two channels:

1. **Analysis Channel:** Chain-of-thought reasoning, problem classification, and qualitative analysis
2. **Final Channel:** Complete Python solver code with numerical grounding, quantitative results, and validation summary

Domain-specific tokens (`<|shaft|>`, `<|python|>`, `<|numerical|>`, `<|latex|>`) demarcate semantic boundaries within the output.

## Inference Configuration

The model was trained **without** sliding window attention, repetition penalty, or n-gram blocking. These techniques must remain **disabled** during inference:

```python
# CORRECT configuration (BASELINE)
use_sliding_window = False
repetition_penalty = 1.0
no_repeat_ngram_size = 0
temperature = 0.0  # greedy decoding
```

Enabling these techniques degrades performance from 94% to 8% correct stop tokens.

## Intended Use

Mini-Enedina is designed for:

- Structural shaft analysis according to Timoshenko beam theory
- Engineering education and design iteration
- Generating complete, executable Python solver code
- Deployment on consumer hardware (edge, air-gapped environments)

**Important:** Model outputs should always be verified against independent calculations for safety-critical applications.

## Limitations

- Handles exclusively shaft analysis according to Timoshenko theory
- Training language is Brazilian Portuguese
- Numerical accuracy is limited by tokenization granularity
- May struggle with support conditions or load combinations not represented in training

## Citation

If you use this model, please cite:

```bibtex
@article{leitaofilho2026minienedina,
  title={Mini-Enedina: A Domain-Specialized Small Language Model for Structural Shaft Analysis Using Timoshenko Beam Theory},
  author={Leit{\~a}o Filho, Antonio de Sousa and Barros Filho, Allan Kardec Duailibe and Lima, Fabr{\'i}cio Saul and Santos, Selby Mykael Lima dos and Sousa, Rejani Bandeira Vieira},
  year={2026}
}
```

## Acknowledgments

This work was supported by Aia Context Ltda. and by FINEP -- Funding Authority for Studies and Projects, a Brazilian government agency for science, technology, and innovation linked to the Ministry of Science, Technology and Innovation (MCTI), under Contract No. 03.25.0080.00.

## License

CC-BY-4.0