Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Monte Carlo Tree Search for Poetry Using GPT (github.com/agentic-ai)
1 point by leopoldhaller 8 months ago | hide | past | favorite
I've been working on enact, a framework that simplifies the implementation of complex generative software flows at https://github.com/agentic-ai/enact.

Enact's core features include the ability to rewind and replay executions of python functions that are annotated in the framework. The linked notebook shows how this can be used to implement a generic Monte Carlo Tree Search (MCTS) algorithm that can be deployed over any annotated python program and directly searches the space of program executions.

MCTS (used, e.g., in the AlphaZero family of algorithms) searches a tree of generative possibilities using a scoring function in order to find high-scoring branches. The notebook deploys MCTS over a line-by-line poetry generator, allowing the algorithm to backtrack and search different completions for the same starting lines.

Baseline (no MCTS):

> While shadows stir and breathe beneath the moon's licentious glow.

> Nightly whispers wind through trees, long lost in their verdurous flow.

> In the echoing silence, secrets lie dormant, awaiting the raven's crow.

> A path unfolds beneath the thorns, where memories and shadows grow.

MCTS Example 1:

>Under the hush of leaves, ancient secrets pass as whispers.

>Shadows dance as the daylight fades, echoing the rhythm of heartbeats.

>In hallowed silence roots entwine, sharing stories with the undergrowth.

>A shiver of twilight laces through, the phantom pulse of a forest's breath.

MCTS Example 2:

> Under the neon hum, craft recedes into shadow,

> Where artistry and mechanics clash, souls are traded for steam and gas.

> Echoes of creation's heart, usurped by iron’s brazen art.

> Infernal gears grind dreams, artists' tears oiling their ceaseless horseplay.

MCTS Example 3:

> Spun by silent looms of determination ragged from use.

> Eyes search the horizon, fingers till the marrow of invention.

> Under quiet cover of the moon, the night was sown with ceaseless creation.

> Mastering chaos, coaxing stars from a coal-darkened hand.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: