Expand description
Β§ByteForge: Next-Generation Byte Transformer
ByteForge is a revolutionary byte-level transformer architecture that significantly improves upon Metaβs Byte Latent Transformer (BLT) with faster, more efficient, and more robust processing.
Β§π Key Features
- Multi-Signal Patching: Combines 5 signals vs BLTβs entropy-only approach
- Ultra-Fast Entropy: 1000x faster than 100M parameter models
- SIMD Optimization: Vectorized operations for maximum throughput
- Memory Efficient: Constant O(1) memory usage per chunk
- Streaming Support: Real-time byte-by-byte processing
Β§π Quick Start
use byteforge::{ByteForgeConfig, MultiSignalPatcher, UltraFastEntropyCalculator};
// Create configuration
let config = ByteForgeConfig::default();
// Initialize components
let mut patcher = MultiSignalPatcher::new(config);
let mut entropy_calc = UltraFastEntropyCalculator::new();
// Build entropy model
let corpus = vec![b"Hello, world!".to_vec()];
entropy_calc.build_from_corpus(corpus)?;
// Process text
let text = "Hello, ByteForge!";
let patches = patcher.patch_bytes(text.as_bytes())?;
println!("Created {} patches", patches.len());
Β§π Performance
ByteForge delivers exceptional performance:
- 4+ GB/s in-memory processing throughput
- 3,000x fewer patches than traditional approaches
- Sub-second processing for 100MB+ datasets
- Linear scalability with data size
Β§π§ TURBO Mode
For maximum performance, use TURBO mode with SIMD acceleration:
use byteforge::{SIMDEntropyCalculator, TurboMultiSignalPatcher};
use std::sync::Arc;
// Create SIMD entropy calculator
let mut simd_calc = SIMDEntropyCalculator::new();
let corpus = vec![b"Sample data".to_vec()];
simd_calc.build_from_corpus_optimized(corpus)?;
// Create turbo patcher
let mut turbo_patcher = TurboMultiSignalPatcher::new(Arc::new(simd_calc));
// Process with maximum speed
let data = b"Large dataset...";
let patches = turbo_patcher.patch_bytes_turbo(data)?;
Re-exportsΒ§
pub use crate::patching::MultiSignalPatcher;
pub use crate::patching::Patch;
pub use crate::patching::PatchType;
pub use crate::entropy::UltraFastEntropyCalculator;
pub use crate::entropy::StreamingEntropyCalculator;
pub use crate::transformer::ByteForgeTransformer;
pub use crate::optimized_entropy::SIMDEntropyCalculator;
pub use crate::optimized_patching::TurboMultiSignalPatcher;
ModulesΒ§
- entropy
- inference
- optimized_
entropy - optimized_
patching - patching
- simple_
benchmark - training
- transformer
- turbo_
benchmark - utils