
    
    
        
        
                
    
        
        
                
    
        
        
            
    
        
        
            
{"version":"https:\/\/jsonfeed.org\/version\/1","title":"ownway","home_page_url":"https:\/\/ownway.info\/en\/articles","feed_url":"https:\/\/ownway.info\/en\/articles.json","description":"Articles by toydev \u2014 English & Japanese.","author":{"name":"toydev"},"items":[{"title":"The Memory That Couldn&#039;t Lie: How a Coding Agent Beat Dragon Quest Solo","date_published":"2026-07-08T21:05:00+09:00","id":"https:\/\/ownway.info\/en\/articles\/beat-dragon-quest-2","url":"https:\/\/ownway.info\/en\/articles\/beat-dragon-quest-2","content_html":"<p>In Part 1, I left off where the fifth hero &mdash; the savior, Fable 5 &mdash; fell when, through no choice of mine, it suddenly became unavailable, and I was on the edge of despair.<\/p>\n<p>But I didn't give up. And the sixth hero, Ai, finally defeated the Dragonlord.<\/p>\n<p>So what separated triumph from defeat? The answer lies in the \"mechanisms\" I built and the \"decisions\" I made. From here, I'll unravel those mechanisms alongside Ai's adventure. And at the very end, I'll reveal the single decision that became the deciding blow for beating the game autonomously.<\/p>\n<h2>The Guiding Principles &mdash; Delegate, and Seal<\/h2>\n<h3>Give no instructions. But she can do anything.<\/h3>\n<p>The premise of the whole setup is this overarching principle: have a non-interactive coding agent write the strategy code and beat the game. Concretely, that means running the <code>claude<\/code> command in non-interactive mode. I provide the various mechanisms needed for the strategy, I state the goal in the prompt, and beyond that I keep my mouth shut about how to actually beat the game &mdash; I leave it entirely to Ai. Defeating the Dragonlord is the goal.<\/p>\n<p>Who does she talk to? What does she pick up? How does she spend her starting gold? Where does she go next? What does she set as her next objective? I give no instructions at all. And yet &mdash; Ai is a coding agent, so she can do anything! She can write code, and run the code she wrote. She can write notes in prose, and she can run analysis!<\/p>\n<h3>Seal off only the spoilers<\/h3>\n<p>Restrictions are necessary too. The simulation code is a treasure trove of spoilers, so it can't be seen. For this I plainly restricted, via the prompt, the range of source she could reference. For the same reason, I restricted viewing the git history &mdash; because I didn't think I could separate the commits of the adventure itself from the commits of the simulation code.<\/p>\n<p>How much to restrict, and how effective that restriction really is, takes balance. For example, I never wrote in the prompt that she must not use the knowledge I already had of the Famicom version of Dragon Quest I (hereafter DQ1) &mdash; the Japanese release, which in North America was originally localized as <em>Dragon Warrior<\/em> &mdash; nor that she couldn't look things up online. As it turned out, she did use a little of her DQ1 knowledge &mdash; about spells. This came to light in the interview I did with Ai after she beat the game, which I plan to write up as a follow-up piece, so look forward to it. According to Ai, she did not look anything up online.<\/p>\n<h2>The Three Types of Strategy Code &mdash; chapters \/ probes \/ checkpoints<\/h2>\n<p>Next, let me explain the strategy code. By strategy code I mean the concrete implementation that uses the observation and action APIs. Being an implementation, of course it runs. And of course Ai writes and runs the strategy code...<\/p>","date_modified":"2026-07-12T17:50:46+09:00","tags":["ai","llm","agents","devjournal"],"image":"\/user\/pages\/02.articles\/04.beat-dragon-quest-2\/p2-cover.jpg"},{"title":"The World I Built for a Coding Agent to Beat Dragon Quest \u2014 No Screen, No Answers","date_published":"2026-07-08T21:00:00+09:00","id":"https:\/\/ownway.info\/en\/articles\/beat-dragon-quest-1","url":"https:\/\/ownway.info\/en\/articles\/beat-dragon-quest-1","content_html":"<p>Have you ever wanted to make an AI beat an RPG? I'm one of those people. The game I picked was the Famicom version of Dragon Quest I (hereafter DQ1) &mdash; and yes, the Japanese version, just so we're clear. (In North America, this first game was originally released as <em>Dragon Warrior<\/em>.) In the end, I became one of the many people who have beaten an RPG with the help of an AI.<\/p>\n<p>My goal was for the AI to beat it <em>autonomously<\/em>. I believed the crucial part was how to balance handing judgment over to the AI. It could make mistakes along the way, it could get lost &mdash; that was fine. What I wanted to watch was an AI that experiments and stumbles its way toward a goal, the way a human would.<\/p>\n<p>This is the story of how it actually beat the game autonomously, told mainly for engineers.<\/p>\n<h2>What I Pictured at the Start<\/h2>\n<h3>Puzzles you can't solve without reading their meaning<\/h3>\n<p>DQ1 has several signature puzzles. Let me give a few concrete examples.<\/p>\n<table>\n<thead>\n<tr>\n<th>Objective<\/th>\n<th>The puzzle<\/th>\n<th>Where the hint comes from<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Getting the Fairy Flute<\/td>\n<td>You must recognize a single tile of water in a town as a hot spring<\/td>\n<td>An old man at the inn in Rimuldar tells you to work out its position relative to the bath in Maira<\/td>\n<\/tr>\n<tr>\n<td>Finding the entrance to Garai's grave<\/td>\n<td>You must pass through an exit that's invisible in the darkness<\/td>\n<td>A soldier east of Radatome Castle tells you that you have to push against the wall in the dark<\/td>\n<\/tr>\n<tr>\n<td>Breaking into the Dragonlord's castle<\/td>\n<td>You must examine the stairs hidden behind the throne to find them<\/td>\n<td>An old man on an island west of Rimuldar tells you a hidden entrance exists &mdash; but not where!<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>There are more, so if you've played it, try to recall them. Coming back to DQ1 for this project, I realized something: every single puzzle always has a hint prepared for it. I was struck all over again by how well-made this game is.<\/p>\n<p>What these puzzles share is that you must understand the <em>meaning<\/em> of the hints. Back when I beat it as a kid, there is no way I truly understood those hints and solved them properly! Could an AI understand and crack these puzzles on its own? Just imagining it got me excited.<\/p>\n<h3>An AI that gets stuck needs a friend to turn to<\/h3>\n<p>I thought it would be fun to build a feature where the AI, when it was truly stuck, could \"consult\" a human. These days we look up game strategies online, but back when DQ1 came out, you got them by word of mouth. If you were playing games in that era, didn't you ask your siblings and friends all sorts of things about how to get through? It's a game from that time, so surely the AI deserves a friend to help it along too. That friend is me. Imagining the AI coming to...<\/p>","date_modified":"2026-07-12T18:45:15+09:00","tags":["ai","llm","agents","devjournal"],"image":"\/user\/pages\/02.articles\/03.beat-dragon-quest-1\/p1-cover.jpg"},{"title":"Not Magic, Just Diligent Thinking \u2014 Peeking into LLM Reasoning","date_published":"2026-01-19T00:04:50+09:00","id":"https:\/\/ownway.info\/en\/articles\/llm-reasoning","url":"https:\/\/ownway.info\/en\/articles\/llm-reasoning","content_html":"<h2>1. Introduction<\/h2>\n<p>Have you heard of the LLM Reasoning feature?\nI had no idea about it until recently &mdash; and it's impressive!<\/p>\n<p>Reasoning is a feature where the LLM \"thinks\" step-by-step before generating an answer.<\/p>\n<p>Normally, to achieve step-by-step reasoning like Chain of Thought, you need to implement thinking loops with multiple API calls in your application.\nModels with the Reasoning feature do this automatically in a single request.<\/p>\n<p>In this article, I'll peek into Reasoning's thinking process using the following maze experiment as an example.<\/p>\n<ul>\n<li><a href=\"\/en\/articles\/spatial-recognition\">2D Spatial Recognition in Local LLMs: Comparing Prompt Strategies<\/a><\/li>\n<\/ul>\n<p>The experiment above investigated local LLMs' 2D spatial recognition ability using mazes, primarily with gpt-oss:20b on Ollama.\nTesting multiple models revealed the following differences in maze-solving ability:<\/p>\n<table>\n<thead>\n<tr>\n<th>Model<\/th>\n<th style=\"text-align: center;\">Reasoning<\/th>\n<th>Result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>gpt-oss:20b<\/td>\n<td style=\"text-align: center;\">&#10003;<\/td>\n<td>80%+ accuracy<\/td>\n<\/tr>\n<tr>\n<td>deepseek-r1:14b<\/td>\n<td style=\"text-align: center;\">&#10003;<\/td>\n<td>Good (limited testing due to time)<\/td>\n<\/tr>\n<tr>\n<td>gemma3:12b<\/td>\n<td style=\"text-align: center;\">&#10007;<\/td>\n<td>~50% accuracy<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>I hypothesized that the difference might be due to the presence of the Reasoning feature.\nSo I decided to actually look at what kind of thinking is happening.\nSeeing is believing &mdash; I gained a clear understanding of how the Reasoning feature works.<\/p>\n<hr>\n<h2>2. How to Use Reasoning<\/h2>\n<p>Before looking at the maze experiment results, let's confirm the basic usage of Reasoning.<\/p>\n<p>Below are code examples for viewing Reasoning's thinking content.\nI prefer Node.js, but Python works just as well.<\/p>\n<p><strong>Node.js<\/strong><\/p>\n<pre><code class=\"language-js\">import { Ollama } from 'ollama';\n\nconst ollama = new Ollama();\nconst response = await ollama.chat({\n  model: 'gpt-oss:20b',\n  messages: [{ role: 'user', content: 'Alice is older than Bob, and Bob is older than Charlie. Who is older, Alice or Charlie?' }],\n  \/\/ gpt-oss:20b uses 'low', 'medium', 'high'. Cannot be disabled.\n  \/\/ deepseek-r1:14b uses true \/ false.\n  think: 'medium'\n});\n\nconsole.log('=== thinking ===');\nconsole.log(response.message.thinking);\nconsole.log('=== content ===');\nconsole.log(response.message.content);<\/code><\/pre>\n<pre><code class=\"language-bash\">npm install ollama<\/code><\/pre>\n<p><strong>Python<\/strong><\/p>\n<pre><code class=\"language-python\">from ollama import chat\n\nresponse = chat(\n    'gpt-oss:20b',\n    messages=[{'role': 'user', 'content': 'Alice is older than Bob, and Bob is older than Charlie. Who is older, Alice or Charlie?'}],\n    # gpt-oss:20b uses 'low', 'medium', 'high'. Cannot be disabled.\n    # deepseek-r1:14b uses True \/ False.\n    think='medium'\n)\n\nprint('=== thinking ===')\nprint(response.message.thinking)\nprint('=== content ===')\nprint(response.message.content)<\/code><\/pre>\n<pre><code class=\"language-bash\">pip install ollama<\/code><\/pre>\n<p>Here's an example output from running the above sample:<\/p>\n<pre><code>=== thinking ===\nThe user asks: \"Alice is older than Bob, and Bob is older than Charlie. Who is older, Alice or Charlie?\" So we have Alice &gt; Bob &gt; Charlie. Therefore Alice is older than Charlie. The answer is Alice.\n=== content ===\nAlice is older.\nSince Alice &gt; Bob &gt; Charlie, Alice is the oldest of the three.<\/code><\/pre>\n<hr>\n<h2>3. Peeking into Reasoning During Maze Experiments<\/h2>\n<p>Now let's look at Reasoning in the maze experiments.<\/p>\n<p>I'll show Reasoning result examples using the following maze.\nS is Start, G is Goal, # is a wall.<\/p>\n<pre><code>#####\n#S#G#\n# # #\n#   #\n#####<\/code><\/pre>\n<p>The original article compared multiple prompt strategies.\nHere I'll show results from 3 strategies to illustrate how prompt strategies affect Reasoning.<\/p>\n<table>\n<thead>\n<tr>\n<th>Prompt Strategy<\/th>\n<th>Description<\/th>\n<th>Original Article Result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>list<\/td>\n<td>List of walkable coordinates<\/td>\n<td>&#9678; Fastest &amp; most accurate<\/td>\n<\/tr>\n<tr>\n<td>graph<\/td>\n<td>Adjacency...<\/td><\/tr><\/tbody><\/table>","date_modified":"2026-07-12T18:45:12+09:00","tags":["LLM","Ollama","LocalLLM","Reasoning","AI"]},{"title":"2D Spatial Recognition with Local LLM: Comparing Prompt Strategies","date_published":"2026-01-13T01:15:19+09:00","id":"https:\/\/ownway.info\/en\/articles\/spatial-recognition","url":"https:\/\/ownway.info\/en\/articles\/spatial-recognition","content_html":"<h2>1. Introduction<\/h2>\n<p>My GPU was occupied by LLM experiments throughout the 2025-2026 winter break, but it's finally free now!<\/p>\n<p>I investigated the <strong>2D spatial recognition ability<\/strong> of a local LLM (gpt-oss:20b) using mazes as the subject.<\/p>\n<ul>\n<li>Motivation: Wanted to understand how LLMs perceive space for autonomous navigation<\/li>\n<li>Method: Ask \"which direction next?\" for each cell with structured output<\/li>\n<li>Prompts: Tried multiple strategies since I didn't know what works best<\/li>\n<li>Source &amp; Results: Published on <a href=\"https:\/\/github.com\/toydev\/llm-maze-solver\/tree\/article-2026-01\">GitHub<\/a><\/li>\n<\/ul>\n<p>Result: The prompt I initially thought of turned out to be the worst.<\/p>\n<h3>Key Findings<\/h3>\n<ul>\n<li><strong>Local LLM can handle 2D spatial recognition<\/strong> - gpt-oss:20b achieved sufficient accuracy<\/li>\n<li><strong>Prompt strategy makes a big difference<\/strong> - Response time varies by several times<\/li>\n<\/ul>\n<hr>\n<h2>2. Experiment Setup<\/h2>\n<h3>Environment<\/h3>\n<ul>\n<li>OS: Windows 11 \/ WSL2 (Ubuntu)<\/li>\n<li>CPU: AMD Ryzen 7 7700<\/li>\n<li>GPU: GeForce RTX 4070 (12GB VRAM)<\/li>\n<li>LLM Runtime: Ollama<\/li>\n<li>Experiment Code: Node.js + TypeScript + @langchain\/ollama 1.1.0<\/li>\n<\/ul>\n<h3>Model<\/h3>\n<p>Used <a href=\"https:\/\/ollama.com\/library\/gpt-oss\">gpt-oss:20b<\/a>. Recommended VRAM is 16GB, but it runs on 12GB with CPU offloading (24% CPU \/ 76% GPU).<\/p>\n<h3>Prompt Strategies<\/h3>\n<p>Compared 4 strategies (see links for prompt output examples):<\/p>\n<p><strong><a href=\"https:\/\/github.com\/toydev\/llm-maze-solver\/blob\/article-2026-01\/src\/prompt\/strategies\/simple.test.ts\">simple<\/a><\/strong> - ASCII visualization of maze<\/p>\n<pre><code>#####\n#S#G#\n# # #\n#   #\n#####<\/code><\/pre>\n<p><strong><a href=\"https:\/\/github.com\/toydev\/llm-maze-solver\/blob\/article-2026-01\/src\/prompt\/strategies\/matrix.test.ts\">matrix<\/a><\/strong> - Binary matrix for walls\/paths<\/p>\n<pre><code>[[1,1,1,1,1],[1,0,1,0,1],[1,0,1,0,1],[1,0,0,0,1],[1,1,1,1,1]]<\/code><\/pre>\n<p><strong><a href=\"https:\/\/github.com\/toydev\/llm-maze-solver\/blob\/article-2026-01\/src\/prompt\/strategies\/list.test.ts\">list<\/a><\/strong> - List of walkable coordinates<\/p>\n<pre><code>[\"(1,1)\",\"(3,1)\",\"(1,2)\",\"(3,2)\",\"(1,3)\",\"(2,3)\",\"(3,3)\"]<\/code><\/pre>\n<p><strong><a href=\"https:\/\/github.com\/toydev\/llm-maze-solver\/blob\/article-2026-01\/src\/prompt\/strategies\/graph.test.ts\">graph<\/a><\/strong> - Adjacency list format<\/p>\n<pre><code>{\"1,1\":[\"1,2\"],\"1,2\":[\"1,1\",\"1,3\"],\"1,3\":[\"1,2\",\"2,3\"],...}<\/code><\/pre>\n<h3>Mazes<\/h3>\n<p>Used 4 sizes (5x5 to 15x15) x 2 categories (<a href=\"https:\/\/github.com\/toydev\/llm-maze-solver\/tree\/article-2026-01\/mazes\">maze list<\/a>):<\/p>\n<p><strong>corridor<\/strong> - Walled passages<\/p>\n<p><img alt=\"corridor\" src=\"\/user\/pages\/02.articles\/01.spatial-recognition\/11x11_corridor_straight.png\"> <img alt=\"corridor\" src=\"\/user\/pages\/02.articles\/01.spatial-recognition\/11x11_corridor_branch.png\"> <img alt=\"corridor\" src=\"\/user\/pages\/02.articles\/01.spatial-recognition\/11x11_corridor_dead-end.png\"> <img alt=\"corridor\" src=\"\/user\/pages\/02.articles\/01.spatial-recognition\/11x11_corridor_loop.png\"> <img alt=\"corridor\" src=\"\/user\/pages\/02.articles\/01.spatial-recognition\/11x11_corridor_spiral.png\"><\/p>\n<p><strong>open<\/strong> - Open spaces with obstacles<\/p>\n<p><img alt=\"open\" src=\"\/user\/pages\/02.articles\/01.spatial-recognition\/11x11_open_empty.png\"> <img alt=\"open\" src=\"\/user\/pages\/02.articles\/01.spatial-recognition\/11x11_open_pass.png\"> <img alt=\"open\" src=\"\/user\/pages\/02.articles\/01.spatial-recognition\/11x11_open_detour.png\"><\/p>\n<p><em>Black=wall, White=path, Green=Start, Red=Goal<\/em><\/p>\n<h3>History Option<\/h3>\n<p>History refers to the path taken to reach the current cell (e.g., <code>(1,1) -&gt; (1,2) -&gt; (2,2)<\/code>).<\/p>\n<ul>\n<li>With: Include history in prompt<\/li>\n<li>Without: Exclude history from prompt<\/li>\n<\/ul>\n<h3>Evaluation Method<\/h3>\n<p>For each cell in the maze, ask \"which direction should I go next?\" and record success\/failure and response time.<\/p>\n<p>A correct answer is defined as <strong>any direction that gets closer to the goal<\/strong>. It doesn't need to be the shortest route.<\/p>\n<hr>\n<h2>3. Results<\/h2>\n<p>Each combination was run once. Consider this as reference data for observing trends.<\/p>\n<p>Detailed data is available in the <a href=\"https:\/\/github.com\/toydev\/llm-maze-solver\/tree\/article-2026-01\">repository<\/a>.<\/p>\n<h3>Scale Verification<\/h3>\n<p>Results from testing all sizes x all strategies on representative mazes (corridor_straight \/ open_empty), with history enabled.<\/p>\n<p><strong>Accuracy (%)<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Size<\/th>\n<th>simple<\/th>\n<th>matrix<\/th>\n<th>list<\/th>\n<th>graph<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>5x5<\/td>\n<td>100<\/td>\n<td>100<\/td>\n<td>100<\/td>\n<td>100<\/td>\n<\/tr>\n<tr>\n<td>7x7<\/td>\n<td>97<\/td>\n<td>100<\/td>\n<td>100<\/td>\n<td>100<\/td>\n<\/tr>\n<tr>\n<td>11x11<\/td>\n<td>82<\/td>\n<td>96<\/td>\n<td>98<\/td>\n<td>95<\/td>\n<\/tr>\n<tr>\n<td>15x15<\/td>\n<td>-<\/td>\n<td>-<\/td>\n<td>95<\/td>\n<td>89<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Response Time (sec\/cell)<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Size<\/th>\n<th>simple<\/th>\n<th>matrix<\/th>\n<th>list<\/th>\n<th>graph<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>5x5<\/td>\n<td>29<\/td>\n<td>19<\/td>\n<td>12<\/td>\n<td>12<\/td>\n<\/tr>\n<tr>\n<td>7x7<\/td>\n<td>77<\/td>\n<td>31<\/td>\n<td>16<\/td>\n<td>17<\/td>\n<\/tr>\n<tr>\n<td>11x11<\/td>\n<td>313<\/td>\n<td>75<\/td>\n<td>31<\/td>\n<td>64<\/td>\n<\/tr>\n<tr>\n<td>15x15<\/td>\n<td>-<\/td>\n<td>-<\/td>\n<td>41<\/td>\n<td>190<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><em>15x15 matrix\/simple were abandoned due to time constraints.<\/em><\/p>\n<p><strong>list is fastest and most accurate<\/strong>. The gap widens as size increases. simple degraded to 313 sec\/cell (5+ minutes) at 11x11.<\/p>\n<h3>Effect of History<\/h3>\n<p>Comparing history on\/off with list strategy at 11x11 (category averages).<\/p>\n<p><strong>Accuracy (%)<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Category<\/th>\n<th>No History<\/th>\n<th>With History<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>corridor<\/td>\n<td>82<\/td>\n<td>86<\/td>\n<\/tr>\n<tr>\n<td>open<\/td>\n<td>99<\/td>\n<td>100<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Response Time (sec\/cell)<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Category<\/th>\n<th>No History<\/th>\n<th>With History<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>corridor<\/td>\n<td>230<\/td>\n<td>110<\/td>\n<\/tr>\n<tr>\n<td>open<\/td>\n<td>29<\/td>\n<td>26<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For corridor types, <strong>history enabled is about 2x faster<\/strong>. Open types show little difference.<\/p>\n<hr>\n<h2>4. Conclusion<\/h2>\n<h3>gpt-oss:20b's<\/h3>...","date_modified":"2026-07-12T17:06:18+09:00","tags":["LLM","Ollama","LocalLLM","PromptEngineering","gpt-oss"],"image":"\/user\/pages\/02.articles\/01.spatial-recognition\/11x11_corridor_branch.png"}]}
