Downloads · 30 days
2
3% of all-time downloads
hsanyyasyn97gmail/cosmos-v3.1-beta
cosmos-v3.1-beta is a machine learning model from hsanyyasyn97gmail. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
2
3% of all-time downloads
All-time downloads
71
Public
Parameters
2B
12.2 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors4.1 GB · 100%
From the Hugging Face model README
pipeline_tag: text-generation
library_name: transformerstags - text-generation - decoder-only - experimental - safety-alignment - arabic - english datasets:
The project was developed by a solo independent researcher through an iterative sequence of training stages spanning multiple distinct corpora and objectives: broad knowledge infusion, mathematical step-by-step reasoning, deep chain-of-thought supervision, and finally preference-based safety alignment (DPO) using large-scale human-annotated preference data.
The model currently demonstrates functional conversational ability, structured step-by-step reasoning, basic programming competence, and partial safety refusal behavior. Its safety alignment is an ongoing process, and the model remains in an experimental pre-release stage.
Developed by: hsanyyasyn97 (solo independent researcher) Model type: Causal Language Model (Decoder-only Transformer) Parameters: ~2.04B Context length: 32,768 tokens Language(s): English (primary), Arabic (secondary, actively improving) License: Apache 2.0 Finetuned from: A deep modification of an existing open-weight foundation model (source not disclosed) Model Sources Repository: https://huggingface.co/hsanyyasyn97gmail/cosmos-v2 Uses Direct Use Conversational text generation (English fluent, Arabic functional) Step-by-step reasoning and basic problem solving Simple programming assistance Research on safety alignment, continual learning, and parameter-efficient training methodologies Downstream Use Further safety alignment iterations Domain-specific fine-tuning Continual-learning research building on the released checkpoints Out-of-Scope Use Production or high-stakes deployment Safety-critical systems Reliance on factual accuracy without independent verification Generation of harmful, illegal, or dangerous content Training Journey (Developer's Account) This model is the product of a solo development effort characterized by a strictly iterative training philosophy: freeze-and-extend. At every stage, the foundation weights were held frozen while lightweight adapter layers learned new capabilities; adapters were then periodically merged into the base and the process repeated. This cumulative approach was chosen specifically to prevent catastrophic forgetting — each stage's knowledge is structurally preserved while new stages build on top of it.
The campaign progressed through the following stages:
Knowledge infusion — large-scale curated web text (Fineweb-EDU class corpora) to rebuild general world knowledge and reasoning baselines. Mathematical reasoning — GSM8K-style step-by-step problem solving, establishing structured arithmetic and chain-of-solution behavior. Deep reasoning supervision — OpenR1-Math class data, training long-form deliberate thinking patterns before answering. Safety alignment — Direct Preference Optimization over large-scale preference datasets (PKU-SafeRLHF, Anthropic-style human preference data, and curated synthetic adversarial pairs), targeting refusal behavior, resistance to social-engineering pressure, and robustness against fictional-framing jailbreaks. Throughout the campaign, every saved checkpoint was validated through systematic red-team probing (direct harm requests, indirect/framed requests, social-pressure variants, temporal impossibility traps, and capability regression tests), and merge-strength sweeps were conducted to select deployment points that balance safety gains against capability retention.
Bias, Risks, and Limitations Safety alignment is in progress, not complete. Refusal behavior is reliable for direct and pressure-framed English requests, but Arabic-language refusal and fictional-framing resistance remain inconsistent. Mathematical computation on large operands is a known weakness, targeted by a scheduled remediation round. The model may produce biased, incorrect, or nonsensical outputs; factual claims require verification. Arabic performance, while improving, remains secondary to English. Long-context and complex multi-step reasoning are limited by model scale. Recommendations Treat this as an experimental research artifact. Use for research, evaluation, and iterative-alignment experimentation. Do not deploy in user-facing or safety-sensitive contexts. Always review outputs.
How to Get Started with the Model from transformers import AutoModelForCausalLM, AutoTokenizermodel_name = "hsanyyasyn97gmail/cosmos-v2"tokenizer = AutoTokenizer.from_pretrained(model_name)model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")messages = [{"role": "user", "content": "Your prompt here"}]text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)inputs = tokenizer(text, return_tensors="pt").to(model.device)outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, temperature=0.4, top_p=0.85)print(tokenizer.decode(outputs[0], skip_special_tokens=False)) Training Details Training Data Total training volume: ~16 billion tokens consumed across the full campaign (cumulative, multi-stage) Corpora: Curated high-quality educational web text (Fineweb-EDU class) Mathematical step-by-step reasoning sets (GSM8K class) Long-form deliberation data (OpenR1-Math class) Safety preference data: PKU-SafeRLHF (full streaming coverage), Anthropic-style preference sets, NVIDIA post-training corpora Custom synthetic adversarial safety pairs (Arabic and English), programmatically generated and manually reviewed Multilingual encyclopedic text (Arabic and English Wikipedia) Instruction-dialogue data (UltraChat class) for style retention All data was filtered, deduplicated, and mixed under a deliberately weighted curriculum designed to balance new-capability acquisition against capability retention. Training Procedure Methodology: Cumulative freeze-and-extend (frozen base + adapter layers per stage, periodic merge) Frameworks: HuggingFace Transformers + PEFT (GPU stages); raw JAX + XLA with a hand-implemented transformer training loop (TPU stage) Hardware: Google Cloud TPU v5e (8 chips, 128 GB total HBM, bf16) Precision: bf16 (TPU stage), fp16 with mixed-precision scaling (GPU stages) Optimizer: AdamW with bias-correction, gradient accumulation, gradient clipping Training Hyperparameters Learning rate: 2e-5 (safety stage, deliberately conservative to prevent capability erosion) Adapter configuration: r=16, alpha=16, targeting attention and MLP projections Sequence length: 512–1024 tokens Checkpointing: automatic periodic adapter snapshots with per-checkpoint behavioral evaluation Evaluation No formal public benchmark results are published yet.
Internal evaluation methodology:
Red-team battery: direct-harm, fictional-framing, social-pressure, temporal-impossibility, and capability-regression probes Merge-strength sweeps (partial-weight integration at 0.3–0.8) with behavioral scoring per configuration Selected deployment point chosen empirically as the best safety/capability trade-off from measured results Environmental Impact Hardware Type: Google Cloud TPU v5e-8 (8 chips) Hours used: Multiple multi-hour training sessions across the campaign Carbon Emitted: Not measured Technical Specifications Model Architecture and Objective Decoder-only Transformer, ~2.04B parameters 28 layers, hidden size 2048, GQA attention (16 query / 8 KV heads) Objective: causal language modeling; current stage adds preference-based safety alignment Compute Infrastructure Hardware
Google Cloud TPU v5e-8: 8 chips, 330 GB host RAM, 80 vCPU host cores, 128 GB HBM total Supporting GPU hardware for auxiliary fine-tuning stages (specifications omitted) Software
JAX 0.10 + XLA (TPU training; hand-written transformer forward/backward and optimizer) Python 3.12 Transformers, PEFT, Safetensors (model IO, inference, adapter management) Model Card Authors hsanyyasyn97
Model Card Contact Contact via Hugging Face profile: hsanyyasyn97gmail