ryanscottbarrett/braille256-v6
braille256-v6: Lattice-Aware Multimodal Braille Model
The first LLM with explicit dot-lattice structure in its architecture.
Model Description
braille256-v6 builds on the multimodal foundation of v5, integrating formal lattice theory into the training pipeline. This is not just a Braille-native model—it's a lattice-native model that understands the mathematical structure of Braille at the architectural level.
Key Innovations
Architecture
Parameters: ~12M
Layers: 4
Heads: 4
Hidden: 256
Vocab: 32,000 (SentencePiece)
Context: 512Lattice Attention
Standard transformer attention computes:
Attention(Q, K, V) = softmax(QK^T / √d) VLattice attention blends this with Braille-aware similarity:
LatticeAttn = (1-λ) * StandardAttn + λ * HammingAttn
where HammingAttn[i,j] = 8 - popcount(token[i] XOR token[j])This gives the model an inductive bias toward understanding Braille structure.
Lattice Embeddings
For the first 256 tokens (corresponding to Braille cells), embeddings are initialized as:
embedding[i] = Σ basis[b] for each raised dot b in cell iThis means similar Braille cells (low Hamming distance) start with similar embeddings.
Morphological Regularization
Training includes a regularization term:
L_morph = ReLU(||emb - erode(emb)|| - ||emb - dilate(emb)||)This encourages embeddings to respect the lattice ordering: erode(x) ≤ x ≤ dilate(x).
Theoretical Foundation
This model implements the formal theory from:
"Theoretical Foundations for 8-Dot Braille-Native LLMs"
Key theoretical components:
- Braille Lattice: Boolean algebra (B⁸, ∧, ∨, ¬) with 256 elements
- Morphological Operators: Erosion, dilation, opening, closing
- Modality-Invariant Representation: (modality, sequence, embedding) triple
- Lattice Metrics: Hamming distance, Jaccard similarity
See: braille_lattice_theory.py for full implementation.
Modality Support
Haptic Evaluation Metrics
v6 introduces new evaluation metrics for tactile quality:
Training Results
Usage
import torch
from train_lattice_v6 import Braille256LatticeModel, LatticeConfig
# Load model
config = LatticeConfig.from_dict(json.load(open("config.json")))
model = Braille256LatticeModel(config)
model.load_state_dict(torch.load("pytorch_model.bin"))
# Generate
input_ids = torch.tensor([[0x28, 0x29, 0x2A]]) # Some Braille tokens
output = model.generate(input_ids, max_length=100)Training
python train_lattice_v6.py \
--corpus corpus/braille_multimodal_corpus.txt \
--tokenizer tokenizers/braille_8dot_32k/braille_8dot_32k.model \
--output models/braille256_v6_lattice \
--steps 10000Training Options
Model Family
Why Lattice-Aware?
Standard LLMs treat tokens as arbitrary symbols. braille256-v6 knows that:
- Braille cells form a lattice: 256 elements with meet (∧) and join (∨)
- Similar cells should have similar representations: Hamming distance matters
- Morphological operations preserve meaning: Erosion/dilation are semantic
- Tactile quality is measurable: Haptic metrics evaluate output quality
This makes v6 the first LLM designed for tactile-first AI.
Citation
@misc{braille256v6,
author = {Barrett, Ryan},
title = {braille256-v6: Lattice-Aware Multimodal Braille Model},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/ryanscottbarrett/braille256-v6}
}License
MIT
Links
- braille256-v5
- braille256-v4
- Lattice Theory Implementation - Mathematical foundations
- Training Script - Full training code with lattice attention
⣿ The first LLM where Braille is not just the output format, but the computational substrate. ⣿
