Settings

Theme

A small neural system that learns structural rewrite rules from 2 examples

re.heavyweather.io

2 points by heavymemory 9 days ago · 1 comment

Reader

heavymemoryOP 9 days ago

This started as a small experiment in structural rewriting. The basic idea is that you give the system two or three before and after examples, press Teach, and it learns that transformation and applies it to new inputs.

It is not an LLM and it is not a template system. There is a small learned component that decides when a rule applies, and the rest is a deterministic structural rewrite engine.

There are a few demo modes:

TEACH: learn a structural rule from examples COMPOSE: apply several learnt rules together TRANSFER: use the same rule in different symbolic domains SIMPLIFY: multi step rewriting CODEMOD: for example you can teach lodash.get to optional chaining from two examples

Once a rule is learnt it generalises to inputs that are deeper or shaped differently from the examples you gave. Everything runs on CPU and learning happens in real time.

Demo: https://re.heavyweather.io

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection