Astrnya-Core-v1 (501.97M Parameters)

Neural Game AI Engine Powered by the DMFT V2.1 Dilated Causal MoE-SSM Architecture

Architect & Researcher: Siddharth Kadbhane

PyTorch License: MIT Architecture: DMFT V2.1 Parameters: 501.97M Causal Receptive Field: 2047 Tokens Verified Scorecard: 10/10 (100%)


1. Overview

Astrnya-Core-v1 is a domain-specific, 501.97M parameter neural game AI research prototype designed to explore real-time sidecar intelligence for indie game engines (Godot 4, Unity, Unreal Engine 5).

Standard generic transformer LLMs suffer from unbounded Key-Value (KV) cache growth ($O(N)$ memory per tick) and unpredictable hallucinations. Astrnya-Core-v1 utilizes the DMFT V2.1 Dilated Causal MoE-SSM architecture to deliver bounded $O(1)$ recurrent caching and strict token-level schema discipline across four core game AI pillars:

  1. Dynamic NPC Dialogue: Context-aware, expressive NPC conversations with persistent character personality, emotional state tags (<EMOTE:APPREHENSIVE>), and dynamic trust scoring (<TRUST:+10>).
  2. Tactical Boss Combat: Real-time boss combat decision-making that tracks player engagement ranges, cooldowns, and combat postures to trigger tactical reactions (<ACTION:PARRY_COUNTER>) and dynamic phase escalations.
  3. AI Story Directors: Dynamic Difficulty Adjustment (DDA) and pacing management that evaluates player survival rates, ammo reserves, and environmental tension (<TENSION:HIGH>) to modulate game pacing.
  4. Procedural Quests: Constrained schema generation producing structured, multi-stage branching quests with strict objective hierarchies and reward balance.

2. Neural Architecture Specifications

Property Value Architectural Significance
Total Parameters 501,970,404 (~501.97M) Rich game context expressivity within indie runtime budgets
Embed Dimension 896 Balanced token projection space
Hidden Dimension 960 Dense recurrent inner representation
SSM Backbone 10 Concentric Floors $\times$ 10 Nodes Dilated causal state-space formulation
Dilation Rates $d = 2^i \implies [1, 2, 4, 8, \dots, 512]$ Exponential receptive field expansion across 10 floors
Causal Receptive Field Exact 2,047 Tokens Full receptive field without attention matrix bloat
Causal Invariance $\Delta_{\text{past}} = 0.00000000$ Mathematically guaranteed zero future-to-past leakage
Routing Engine Top-2 Sparse MoE Hub Sparsely routed experts with auxiliary load-balancing loss
Inference Footprint $O(1)$ Recurrent Cache Constant memory footprint during step-by-step game loop ticks

3. Verified Benchmark Scorecard (10/10 โ€ข 100.0%)

Astrnya-Core-v1 has been benchmarked and verified across 10 end-to-end stress-test scenarios covering all four game pillars:

# Test Scenario Pillar Prefix-Trie Whitelist Zero-Leak Invariance Output Syntax Scorecard
1 Eldoria Village Merchant NPC Dialogue Active $\Delta = 0.00000000$ Valid JSON PASSED
2 Ancient Forest Hermit NPC Dialogue Active $\Delta = 0.00000000$ Valid JSON PASSED
3 Cyberpunk Shadow Broker NPC Dialogue Active $\Delta = 0.00000000$ Valid JSON PASSED
4 Steampunk Inventor NPC Dialogue Active $\Delta = 0.00000000$ Valid JSON PASSED
5 Grim Dark Necromancer Boss Combat Active $\Delta = 0.00000000$ Valid JSON PASSED
6 Tavern Brawl Companion NPC Dialogue Active $\Delta = 0.00000000$ Valid JSON PASSED
7 Dragon Phase-2 Transition Boss Combat Active $\Delta = 0.00000000$ Valid JSON PASSED
8 Sci-Fi Derelict AI Director Story Director Active $\Delta = 0.00000000$ Valid JSON PASSED
9 Royal Court Diplomat NPC Dialogue Active $\Delta = 0.00000000$ Valid JSON PASSED
10 Arena Champion Dual Stance Boss Combat Active $\Delta = 0.00000000$ Valid JSON PASSED

4. Game AI Prompt & Output Examples

Example 1: Dynamic NPC Dialogue

<ROLE: NPC_DIALOGUE>
Character: Valen (Town Blacksmith) | Mood: Grumpy | Trust: 45
Player: "Can you repair this ancient blade before nightfall?"
State: [Player_Gold: 120, Sun_Position: Low]
Response:

Output:

{
  "dialogue": "It's late and my forge is dying down. It'll cost you double, traveler, but the steel will hold.",
  "emotion": "<EMOTE:TIRED_RESOLUTE>",
  "trust_delta": 5,
  "state_update": {"gold_cost": 80, "repaired": true}
}

Example 2: Tactical Boss Combat

<ROLE: BOSS_COMBAT>
Boss: Gorgon Knight | Phase: 2 | HP: 38% | Player_Stance: Heavy_Charged
Distance: 3.2m | Boss_Cooldowns: [Shield_Bash: Ready, Stone_Gaze: 4s]
Response:

Output:

{
  "action": "<ACTION:PARRY_COUNTER>",
  "target_bone": "weapon_arm",
  "combo_queued": "Shield_Bash",
  "boss_dialogue": "Your guard is wide open!"
}

Example 3: AI Story Director (Dynamic Difficulty Adjustment)

<ROLE: STORY_DIRECTOR>
Player_Health: 18% | Deaths_Past_10min: 3 | Current_Area: Sunken_Cathedral
Tension_Target: 0.65 | Current_Tension: 0.88
Response:

Output:

{
  "ambient_tension": "<TENSION:MODERATE>",
  "spawn_directive": "HOLD_WAVE",
  "resource_drop_override": "Health_Vial_Tier_1",
  "narrative_cue": "The distant chanting subsides into an eerie silence."
}

Example 4: Procedural Quest Generation

<ROLE: PROCEDURAL_QUEST>
Faction: Iron_Guild | Region: Ashen_Peaks | Danger_Level: 4
Theme: Sabotage | Player_Reputation: Honored
Response:

Output:

{
  "quest_title": "Smothering the Smelters",
  "stages": [
    {"stage": 1, "objective": "Infiltrate the lower foundry unseen", "type": "Stealth"},
    {"stage": 2, "objective": "Overload the 3 thermal valves", "type": "Interact"},
    {"stage": 3, "objective": "Extract before the pressure collapse", "type": "Escape"}
  ],
  "rewards": {"gold": 450, "reputation": 25, "item": "Foundry_Master_Insignia"}
}

5. Work-in-Progress Research Prototype Disclosure

Honest Prototype & Scope Disclosure:

  • Active Research Exploration: Astrnya-Core-v1 is an independent, open research prototype exploring dilated causal state-space modeling (SSM) and sparse Mixture-of-Experts (MoE) for game runtime execution. The weights were distilled from Qwen-0.5B on structured game dialogues, combat matrices, and synthetic game actions.
  • Not Tested in Commercial Production: This model has not yet been tested inside a live commercial game engine (e.g. shipping titles on Steam or production Unreal Engine 5 / Unity games). It is designed as an architectural exploration and standalone sidecar prototype for indie developers, game researchers, and ML engineers to evaluate.
  • Domain-Specific Scope: The model is tuned for structured game tags (<ACTION:...>, <EMOTE:...>, <STATE_UPDATE>) and compact JSON payloads. It is not intended for open-domain web browsing, general-knowledge QA, or generic coding assistance.

6. Quickstart (Inference in 5 Lines of Python)

git clone https://huggingface.co/Siddharthpixel/astrnya-core-v1
cd astrnya-core-v1
pip install torch tiktoken
python quickstart_inference.py

Python API Usage

import torch
import tiktoken
from dmft_v2_1_core import DMFT_V2_1_Model

device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = tiktoken.get_encoding("gpt2")

# Instantiate architecture
model = DMFT_V2_1_Model(
    vocab_size=50257, embed_dim=896, hidden_dim=960,
    num_floors=10, num_nodes_per_floor=10, top_k=2, tie_weights=True
).to(device)

# Load weights
state_dict = torch.load("astrnya_core_v1.pth", map_location=device, weights_only=False)
model.load_state_dict(state_dict)
model.eval()

# Generate dialogue
prompt = "<ROLE: NPC_DIALOGUE>\nCharacter: Valen\nPlayer: Can you repair this?\nResponse: "
input_ids = torch.tensor([tokenizer.encode(prompt)], dtype=torch.long, device=device)

with torch.no_grad():
    for _ in range(30):
        logits = model(input_ids)[:, -1, :]
        next_tok = torch.argmax(logits, dim=-1, keepdim=True)
        input_ids = torch.cat([input_ids, next_tok], dim=-1)

print(tokenizer.decode(input_ids[0].tolist()))

7. Citation

@software{kadbhane2026astrnya,
  author = {Kadbhane, Siddharth},
  title = {Astrnya-Core-v1: Dilated Causal MoE-SSM Neural Game AI Engine},
  year = {2026},
  publisher = {Hugging Face},
  url = {https://huggingface.co/Siddharthpixel/astrnya-core-v1}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support