CoolFace
Apppublic

dixisouls/VelocityLM

sourceHugging Facemitupdated 19d agoView on Hugging Face
0likes
App README

๐Ÿค– Custom LLM - Foundational Language Model

A custom-trained foundational language model with 2 billion parameters, built with modern transformer architecture and deployed with streaming text generation capabilities.

๐Ÿš€ Features

  • โ€”Custom Architecture: Modern transformer with RoPE (Rotary Position Embedding), RMSNorm, and SwiGLU activation
  • โ€”Streaming Generation: Real-time text generation with token-by-token streaming
  • โ€”Flexible Sampling: Configurable temperature, top-p, top-k, and repetition penalty
  • โ€”ZeroGPU Integration: Optimized for Hugging Face Spaces with GPU acceleration
  • โ€”Responsive UI: Clean, intuitive Gradio interface

๐Ÿ“Š Model Details

SpecificationValue
Parameters~2 billion
ArchitectureCustom Transformer
Context Length2,048 tokens
Vocab Size50,257 (GPT-2 tokenizer)
Layers24
Attention Heads32
Hidden Size2,048
Intermediate Size8,192

๐Ÿ—๏ธ Architecture Components

  • โ€”RMSNorm: Root Mean Square Layer Normalization for better training stability
  • โ€”RoPE: Rotary Position Embeddings for better length extrapolation
  • โ€”SwiGLU: Switch GLU activation function for improved performance
  • โ€”Causal Attention: Standard autoregressive attention mechanism

๐ŸŽฏ Training Details

  • โ€”Dataset: Falcon RefinedWeb (curated web text)
  • โ€”Training Steps: 100,000 steps
  • โ€”Learning Rate: 6e-4 with warmup and decay
  • โ€”Batch Size: 32 (4 per device ร— 8 accumulation steps)
  • โ€”Optimization: AdamW with ฮฒ1=0.9, ฮฒ2=0.95
  • โ€”Precision: Mixed precision (FP16)

๐Ÿ› ๏ธ Generation Parameters

  • โ€”Max Tokens: Control the length of generated text (1-1024)
  • โ€”Temperature: Sampling randomness (0.1-2.0, higher = more creative)
  • โ€”Top-p: Nucleus sampling threshold (0.1-1.0)
  • โ€”Top-k: Top-k sampling limit (0-200, 0 = disabled)
  • โ€”Repetition Penalty: Reduce repetitive text (1.0-2.0)

๐Ÿ’ก Usage Tips

  1. 1.For Creative Writing: Use higher temperature (1.0-1.5) and top-p (0.9-0.95)
  2. 2.For Factual Content: Use lower temperature (0.3-0.7) and top-p (0.8-0.9)
  3. 3.For Code Generation: Use temperature ~0.2 with top-k filtering
  4. 4.Longer Context: The model handles up to 2,048 tokens of context

๐Ÿšจ Limitations

  • โ€”Knowledge Cutoff: Training data knowledge cutoff varies by source
  • โ€”Biases: May reflect biases present in training data
  • โ€”Factuality: Generated content should be verified for factual accuracy
  • โ€”Context Window: Limited to 2,048 tokens (approximately 1,500 words)

๐Ÿ”ง Technical Implementation

The model uses a custom PyTorch implementation with:

  • โ€”Efficient attention mechanisms
  • โ€”Memory-optimized layer implementations
  • โ€”Streaming generation with proper token handling
  • โ€”GPU acceleration via ZeroGPU

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • โ€”Hugging Face for the Spaces platform and ZeroGPU infrastructure
  • โ€”The open-source community for transformer implementations and best practices
  • โ€”TII UAE for the Falcon RefinedWeb dataset

Note: This is a foundational language model trained for research and educational purposes. Please use responsibly and be aware of potential biases and limitations.