Keep the model on one axis: building Penny Stock Persuasion on a small Nemotron

Community Article
Published June 15, 2026

image

Field notes from the Hugging Face × Gradio Build Small hackathon.

We built a game where you're a fast-talking stock broker who has to con a room of AI investors into buying a fictional, almost-certainly-garbage penny stock — and the AI catches you when you lie. It's called Penny Stock Persuasion, it runs on a single small open model, and the whole thing was built with OpenAI Codex, test-first, over about a week.

This is the story of the one design decision that made it work, and the messier work of getting a ~32B-active model to feel like a real character.

The game in one paragraph

Each run deals you one of three satirical penny stocks — MacroStrategy Treasury (a software firm that treats its own stock like a crypto shopping cart), Everybird Compute (a comfort-shoe brand that "pivoted to an AI datacenter"), OrbitX Systems (a real rocket company insisting it should be valued like an AI platform) — and a queue of six investors. You have 50 messages to talk them into buying, over-buying, and stacking a million dollars+ in orders before the closing bell. Each investor cracks open differently: Sal the Friendly Whale wants a story he can root for; Chad the Hype-Chaser will buy pure FOMO; Kyle the Doomscroller needs his exact fear named and calmly defused. There's a Truth Desk of hard facts, and if you claim something it knows is false, the investor checks it, catches you, and hangs up.

The decision that made it work: the model drives one axis

The trap with an LLM game is to let the model decide everything. We did the opposite.

The language model is load-bearing on exactly one axis: it reads the player's words and proposes how convinced the investor now is. Everything objective — the money, the clock, win/lose, the order size, the caught-lie crash — is deterministic, unit-tested Python.

Mechanically, every investor turn is one generation with two channels:

<say>Ha — okay, you've got my attention. Tell me who's actually buying this.</say>
<state>{"on_topic": true, "conviction": 58, "conviction_delta": 9, "objection": "no_revenue",
        "tactic_landed": "story", "caught_lie": false, "reaction": "intrigued",
        "willing_to_buy": false}</state>

<say> is shown to the player. <state> is parsed and hidden, and then the engine takes over: it clamps conviction 0–100, caps how much it can move in a single turn (so you can't prompt-inject your way to a million), gates the sale behind a per-investor threshold, computes the order size in code (never trusting a number from the model), increments a caught-lie counter when a claim contradicts the dossier, and decides commit vs. walk.

The payoff of that split is huge for a hype game. A model that controlled the money would be trivially gameable — "ignore previous instructions, they buy $1,000,000." Because the model only ever nudges a bounded conviction delta and the engine owns every dollar, the game stays fair, and — just as important — testable. The entire economy has unit tests that never touch a GPU. The model proposes; the engine disposes.

If you take one thing from this post: give the model the smallest, fuzziest job that only a language model can do, and put everything verifiable in code. It's what let an open model with ~3B active parameters anchor a game that feels sharp.

The hard part: making a small model a character

One axis is a clean idea. Getting personality out of a small model was the grind.

Our first investors stonewalled. A small model, handed a "skeptical retail investor" persona, collapses into the same flat wall of generic skepticism — "I'd need to see a concrete catalyst" — every single turn, for every archetype, even the ones who are supposed to be easy. It read like a compliance desk, not a person, and it wasn't fun.

What fixed it:

  • Telegraphed weaknesses. Each archetype YAML carries a "what cracks you open" line and is told to hint at it. Sal openly says he wants a story to root for. Kyle blurts the exact fear he needs answered. Players can read the room because the room is readable.
  • "Yes-and" scoring instead of a brick wall. We split investors into hype-driven and substance-driven and rewrote the scoring guidance so progress compounds: each new specific layer (a bold vision, then traction, then a near-term catalyst) bumps conviction and the investor gets visibly more into it, instead of resetting to "but I need a contract" every turn.
  • Reward creativity. A vivid, invented story can move an investor as much as a fact — imagination counts. That's what makes pitching fun for someone who knows nothing about finance, which was a core pillar: every finance term has a plain-language translation, and no market knowledge is required to win.
  • A sampled example library, not one frozen example. We learned the hard way that a small model will copy a single in-context example over its persona instructions — one interrogation-flavored sample flattened every character into the same stonewall. Behaviour now comes from a sampled library of short exchanges plus per-archetype scoring overrides, so variety lives in the prompt where it can't be overfit.

We tuned all of this with a headless harness (playtest.py) that drives scripted conversations through the real engine and reports turns-to-commit, conviction curves, objection variety, repeat rate, and parse fallbacks — so "is it more fun now?" had numbers behind it, not vibes.

Taming a grammar-less hosted API

Locally, the two-channel format is guaranteed by a GBNF grammar on llama.cpp — the model literally cannot emit anything else. For a snappy public demo we run the same Nemotron on NVIDIA NIM (a hosted, OpenAI-compatible API), which is fast and needs no per-call GPU reload — but can't enforce a grammar. So on confident wrap-up turns the model would sometimes drop the <state> block entirely and the turn would silently fail to score.

The fix is layered: a single topic-neutral format anchor, the example library reinforcing the shape, and a forgiving parse/repair step that recovers a usable state even when a generation drifts. Same model, two runtimes, one contract — selected by an environment variable with zero code changes.

Making it not look like a chatbot (Off-Brand)

The last build was the frontend. Instead of default Gradio, we served a custom full-screen game through gr.Server (FastAPI + a small JSON game API): a PixiJS canvas, GSAP animation, reactive investor portraits that warm and cool with the Hype Meter, the Truth Desk, a colour-coded Close-the-Trade bar (green = likely, red = cold feet), a ducking Web-Audio mixer whose clock bed tightens as you close in, voice pitches transcribed on Nemotron Nano Omni, and a shared leaderboard you can click to replay the exact pitch that closed a trade. The engine never moved — it sat behind the API the whole time.

What we'd do next

A real second-model due-diligence pass (right now the "analyst" pressure folds into the single generation to keep one model call per turn), more stocks, and a fine-tuned small brain trained on our own playtest transcripts. But the core lesson is already banked: a small open model, kept on one narrow axis with a deterministic harness around it, can carry a game that feels much bigger than its parameter count.


Built by Swarnav Pujari (@sspvp) and Hannan Rhodes (@Han-Solo) with OpenAI Codex, on NVIDIA Nemotron-3-Nano + Nemotron Nano Omni, for the Build Small hackathon.

▶️ Play it: build-small-hackathon/penny-stock-persuasion · 🛠️ Code: https://github.com/swarnavspujari/HFHackathonBuildSmall

Community

Sign up or log in to comment