<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shinka Spool Labs</title>
    <description>The latest articles on DEV Community by Shinka Spool Labs (@shinkaspool).</description>
    <link>https://dev.to/shinkaspool</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4255304%2Fbe20f33f-5638-49c5-8221-5366d512e134.png</url>
      <title>DEV Community: Shinka Spool Labs</title>
      <link>https://dev.to/shinkaspool</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shinkaspool"/>
    <language>en</language>
    <item>
      <title>How I Fixed Repetition Loops in an Abliterated Local LLM (Measured, Not Guessed)</title>
      <dc:creator>Shinka Spool Labs</dc:creator>
      <pubDate>Fri, 20 Nov 2026 09:39:36 +0000</pubDate>
      <link>https://dev.to/shinkaspool/how-i-fixed-repetition-loops-in-an-abliterated-local-llm-measured-not-guessed-232n</link>
      <guid>https://dev.to/shinkaspool/how-i-fixed-repetition-loops-in-an-abliterated-local-llm-measured-not-guessed-232n</guid>
      <description>&lt;p&gt;If you run abliterated (uncensored) local models, you may have seen this: you ask for a short piece of writing, and instead of finishing, the model starts saying the same sentences again. And again. And again.&lt;/p&gt;

&lt;p&gt;I measured that loop on my own machine, changing one setting at a time. Setup: &lt;code&gt;qwen3.5-abliterated:9b&lt;/code&gt; on a Mac mini, in Ollama and llama.cpp, same prompt every run (a ~1,000-character essay on Japan's four seasons). One run per setting — see the limitations at the end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The symptom:&lt;/strong&gt; with no repetition settings, the model produced 16,291 characters instead of ~1,000, and &lt;strong&gt;76% of its sentences were repeats&lt;/strong&gt;. The most-repeated sentence appeared 13 times. A light &lt;code&gt;repeat_penalty&lt;/code&gt; of 1.1 barely helped: 17,344 characters, still 76%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disclosure
&lt;/h2&gt;

&lt;p&gt;Based on my own local experiments (cost: time and electricity only). The final section's two links (Novita AI, Vast.ai) are affiliate links — I may earn a commission at no additional cost to you. I have &lt;strong&gt;not&lt;/strong&gt; paid for or used either service, so nothing here is a first-hand review; they are described only from their official pages, as options when local hardware is not enough. A longer paid measured note from the same experiments exists (end of this article).&lt;/p&gt;

&lt;h2&gt;
  
  
  Ollama: the range mattered, not the value
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Repeated&lt;/th&gt;
&lt;th&gt;Most repeats&lt;/th&gt;
&lt;th&gt;Ending&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No penalty&lt;/td&gt;
&lt;td&gt;76%&lt;/td&gt;
&lt;td&gt;13×&lt;/td&gt;
&lt;td&gt;Cut off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;repeat_penalty 1.1 only&lt;/td&gt;
&lt;td&gt;76%&lt;/td&gt;
&lt;td&gt;11×&lt;/td&gt;
&lt;td&gt;Cut off&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.15 + repeat_last_n 1024&lt;/td&gt;
&lt;td&gt;52%&lt;/td&gt;
&lt;td&gt;6×&lt;/td&gt;
&lt;td&gt;Natural end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.3 + repeat_last_n 1024 ("rp3")&lt;/td&gt;
&lt;td&gt;6%&lt;/td&gt;
&lt;td&gt;2×&lt;/td&gt;
&lt;td&gt;Concluded&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The pattern points at &lt;code&gt;repeat_last_n&lt;/code&gt; — the window the penalty looks at. Ollama's default is 64 tokens; a sentence-level loop returns hundreds of tokens later, outside that window, so the penalty never sees it. Widening the window worked; raising the value alone did not.&lt;/p&gt;

&lt;p&gt;My current Ollama setting: &lt;code&gt;repeat_penalty 1.3&lt;/code&gt; + &lt;code&gt;repeat_last_n 1024&lt;/code&gt;. Caveat: at 1.3 the Japanese near the end got slightly unnatural. If naturalness matters more, start at 1.15 with &lt;code&gt;repeat_last_n 1024&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  llama.cpp: the loop was in the reasoning
&lt;/h2&gt;

&lt;p&gt;llama-server returns reasoning and answer separately, so I measured them separately:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Condition&lt;/th&gt;
&lt;th&gt;Reasoning repetition&lt;/th&gt;
&lt;th&gt;Answer repetition&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No DRY&lt;/td&gt;
&lt;td&gt;64% (max 9×)&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DRY multiplier 0.8&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DRY multiplier 0.4&lt;/td&gt;
&lt;td&gt;5%&lt;/td&gt;
&lt;td&gt;0%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The biggest finding: &lt;strong&gt;the loop lived in the reasoning, not the answer.&lt;/strong&gt; Ollama's &lt;code&gt;ollama run&lt;/code&gt; mixes both into one stream, so the 76% → 6% above was mostly a reasoning loop. DRY 0.8 erased the loop but caused heavy overuse of Japanese quotation marks (52.3 per 1,000 characters vs 1.3 baseline). At 0.4, repetition stayed low (5%) and the overuse dropped to about a third (15.0). My current setting: DRY multiplier ~0.4, base 1.75, &lt;code&gt;dry_penalty_last_n 8192&lt;/code&gt;, ctx 16384.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Every setting was run &lt;strong&gt;once&lt;/strong&gt;; sampling randomness is not separated from the settings' effects. Treat these as measured indications, not proven constants.&lt;/li&gt;
&lt;li&gt;All numbers come from one model and one prompt. Yours may behave differently.&lt;/li&gt;
&lt;li&gt;Stronger settings cost some naturalness. The values above are a balance point, not a free win.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When local isn't enough
&lt;/h2&gt;

&lt;p&gt;A Mac mini was enough for a 9B model. For much larger models, the realistic options are renting GPU time or using a hosted API. Two services that publish official information about this (starting points for your own comparison, not personal recommendations — I haven't used them):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Novita AI&lt;/strong&gt; — hosted model APIs and GPU services. &lt;a href="https://novita.ai/?ref=m2zhmmz&amp;amp;utm_source=affiliate" rel="noopener noreferrer"&gt;https://novita.ai/?ref=m2zhmmz&amp;amp;utm_source=affiliate&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vast.ai&lt;/strong&gt; — a marketplace for renting GPU compute. &lt;a href="https://cloud.vast.ai/?ref_id=870806" rel="noopener noreferrer"&gt;https://cloud.vast.ai/?ref_id=870806&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check current pricing and terms on the official sites before paying — I can't verify those from experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  The full measured note
&lt;/h2&gt;

&lt;p&gt;This article is the summary. The fuller measured note (complete settings, exact configurations, side-effect counts, caveats) is here: &lt;a href="https://shinkalabs.gumroad.com/l/rnjmph" rel="noopener noreferrer"&gt;https://shinkalabs.gumroad.com/l/rnjmph&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you try rp3 or DRY 0.4 on a different model, I'd like to hear whether the loop behaved the same way.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>opensource</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
