Skip to content

yann112/GridGlyph

Repository files navigation


GridGlyph

A Symbolic Reasoning Engine for Solving Visual Logic Puzzles

GridGlyph is a hybrid symbolic + AI system designed to solve grid-based visual reasoning puzzles (like those in the Abstraction and Reasoning Corpus — ARC). It transforms numeric grids into abstract symbolic representations and learns deterministic transformation rules expressed as sigils in a custom DSL.

Unlike traditional approaches, GridGlyph ensures:

  • Multiple puzzle instances of the same underlying rule converge in the latent embedding space
  • DSL rules are deterministic, symbolic, and interpretable
  • Novel combinations of atomic operations are possible without hallucination

🧩 Core Concepts

1. GridGlyph Pipeline

The full system that solves visual pattern puzzles using symbolic abstraction and embeddings.

GridGlyph teaches AI to see transformations structurally:

  • Not by raw numeric values
  • But by object counts, patterns, repetition, mirroring, rotation
  • Using embeddings → DSL predictor → execution → scoring

2. Embedding-Based Reasoning & Rule Generalization

Encode puzzles into a latent space capturing structural features, forcing multiple representations of the same rule to converge.

  • Multiple views per rule: Every puzzle rule is represented by all available input/output examples, possibly with symbolic perturbations (shuffled numbers, reordered objects) to create diverse variants.
  • Convergent embedding: Feeding all variants into the embedding encoder forces latent vectors of the same rule to align, independent of numeric ordering.
  • DSL prediction: A compact model predicts the DSL sequence of sigils directly from the embedding. Since embeddings converge, the model produces a unique, deterministic symbolic output for each underlying transformation.

Benefits:

  • Deterministic, interpretable rule output
  • No hallucination
  • Supports novel recombinations of atomic operations
  • Simplified, compact model training

3. Sigils and DSL Rules

Transformation rules expressed as symbolic operations (DSL), not Python functions.

A sigil is a symbolic character or sequence representing an atomic transformation in the GridGlyph DSL.

Examples of atomic sigils:

  • → reference to input grid
  • → identity (no change)
  • → rotate grid clockwise
  • → horizontal flip
  • → vertical flip
  • → apply operation to a row
  • → apply operation to a column

Combining sigils:

Sigils can be nested or sequenced to form complex transformation programs.

Example DSL Sigil Sequence:

T = [→(⌂, ◨(III)), ↔(R0), ↻(I)]
  • →(⌂, ◨(III)) → apply horizontal repeat 3 times to row of input grid
  • ↔(R0) → flip row 0 horizontally
  • ↻(I) → rotate entire input grid clockwise

Why sigils:

  • Encodes transformations in a deterministic, interpretable, symbolic way
  • Executable directly by the DSLExecutor
  • Supports recombination and extension with atomic DSL operations

🔁 Pipeline Overview

  1. Input Puzzle: Numeric input/output grid pairs
  2. Generate Variants: Create several puzzle instances for the same rule (object shuffle, symbol remapping, reordered rows/columns)
  3. Embedding Encoder: Map grids to latent space, forcing embeddings of same-rule variants to cluster
  4. DSL Predictor: Train a compact model to output sigil sequences from embeddings
  5. Execute Sigil: Run predicted symbolic transformations on input grids
  6. Score: Compare predicted output vs expected results
  7. Optional Feedback Loop: Retry or augment if outputs are inconsistent

🧠 Why This Approach Works

  • Embedding alignment ensures deterministic rule outputs
  • Multiple puzzle variants improve generalization
  • DSL-based execution eliminates hallucination
  • Atomic operations + recombination allow solving unseen puzzles

⚡ Advantages

  • Deterministic, interpretable transformation rules
  • Can handle many variations of the same underlying rule
  • Compact models, less compute than full LLMs
  • Supports recombination of atomic transformations for unseen puzzles
  • Embeddings encourage generalization and rule alignment

🛠️ Development Notes

  • Start with atomic sigils, validate manually
  • Generate multiple variants per rule for embedding convergence
  • Train embeddings and DSL predictor jointly
  • Track rule execution and scores to ensure convergence

About

kaggle competition arcprize 2025

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors