botbottingbot's picture
Update README.md
4afedc8 verified
|
raw
history blame
4.04 kB
metadata
license: mit
language:
  - en
pipeline_tag: text-generation
library_name: transformers
tags:
  - Modular
  - Intelligence

Modular Intelligence

A Small but Complete Reasoning System Built on Top of a Language Model

System-Level View (60 Seconds)

This repository is not a standard GPT-2 model.
It is a compact reasoning system built on top of an LLM, using:

  • Modules – structured reasoning lenses
  • Checkers – strict second-pass reviewers
  • Contracts – fixed output sections for every module
  • Optional Router – automatic module selection from free-form tasks

Pipeline:

Task β†’ Lens (Module) β†’ Structured Output β†’ Checker (Optional)

The LLM engine is replaceable; the architecture is the system.


Architecture

+β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”+ | MODULAR INTELLIGENCE | +β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”+ | User Task | | | | | v | | [Auto-router or manual module selection] | | | | | v | | +———————–+ +β€”β€”β€”β€”β€”β€”β€”β€”+ | | | GENERATOR MODULE | ––> | CHECKER MODULE | | | | (structured output) | | (optional verification)| | | +———————–+ +β€”β€”β€”β€”β€”β€”β€”β€”+ | | | ^ | | v | | | Structured Output Feedback / Fix Ideas | +β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”+


Repository Contents

  • modules.json β€” all modules, inputs, sections, checkers
  • app.py β€” Gradio UI with optional auto-routing
  • Model card
  • GPT-2 base model (fully swappable)

Problem This Solves

Standard LLMs: unstructured text, drift, no audit trail.
Modular Intelligence: task decomposition, structured reasoning, verification, consistency, interpretability.


Modules (Lenses)

Module Use
Analysis Note Explain or break down text/situations
Document Explainer Summaries of contracts/policies/articles
Strategy Memo Options β†’ Recommendation β†’ Risks β†’ Next Steps
Message/Post Reply Structured replies
Profile/Application Bios, cover letters, statements
System Blueprint Design or improve systems and workflows
Modular Brainstorm Decompose problems into modules/checkers

Checker Layer

Checkers produce:

  • VERDICT
  • ALIGNMENT
  • STRUCTURE
  • GAPS
  • FIXES

Implements: Reason β†’ Critique β†’ Refine.


End-to-End Example

Task: β€œShould we expand into a new city in 6 months?”

  1. Select strategy_memo_v1
  2. Fill: context, objective, constraints
  3. Run β†’ structured memo with required sections
  4. Run checker β†’ verdict + issues + fixes

Auto-Routing (Optional)

The provided app.py includes an Auto-Route tab:

  1. Paste free-form task
  2. Zero-shot classifier ranks modules
  3. Jump directly to best lens

Code Usage

from transformers import AutoTokenizer, AutoModelForCausalLM

tok = AutoTokenizer.from_pretrained("botbottingbot/Modular_Intelligence")
model = AutoModelForCausalLM.from_pretrained("botbottingbot/Modular_Intelligence")

prompt = """
MODULE: Strategy Memo
INPUTS:
CONTEXT: We are expanding to City X.
OBJECTIVE: Decide whether to enter within 6 months.
CONSTRAINTS: Budget limits; regulatory uncertainty.

OUTPUT SECTIONS:
- CONTEXT
- OBJECTIVE
- CONSTRAINTS
- OPTIONS
- RECOMMENDATION
- RISKS
- NEXT_ACTIONS
"""

inp = tok(prompt, return_tensors="pt")
out = model.generate(**inp, max_new_tokens=250)
print(tok.decode(out[0], skip_special_tokens=