<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://masokan.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://masokan.github.io/" rel="alternate" type="text/html" /><updated>2026-10-19T22:24:47+00:00</updated><id>https://masokan.github.io/feed.xml</id><title type="html">Ideas And Thoughts to Share</title><subtitle>My blogs</subtitle><entry><title type="html">An Experiment With Openweight LLMs</title><link href="https://masokan.github.io/2026/10/16/an-experiment-with-openweight-LLMs.html" rel="alternate" type="text/html" title="An Experiment With Openweight LLMs" /><published>2026-10-16T00:00:00+00:00</published><updated>2026-10-16T00:00:00+00:00</updated><id>https://masokan.github.io/2026/10/16/an-experiment-with-openweight-LLMs</id><content type="html" xml:base="https://masokan.github.io/2026/10/16/an-experiment-with-openweight-LLMs.html"><![CDATA[<h1 id="introduction">Introduction</h1>

<p>Recently, open source developers and proprietary vendors have been
releasing open weight LLMs with permissive licensing. These models can
run locally on a user's PC without sending private data to any vendor.
There is no need to worry about token cost or quota. These coupled with
the fact that LLMs now have incorporated
<a href="https://arxiv.org/pdf/2201.11903">chain-of-thought</a> motivated me to try
these models.</p>

<h1 id="models-for-the-experiment">Models for the experiment</h1>

<p>There is a plethora of open source/weight models to choose from. I tried
the following models for the experiment:</p>

<ul>
  <li><a href="https://huggingface.co/google/gemma-4-12B">gemma4:12b</a> (Google's
Gemma 4 with 12 billion parameters)</li>
  <li><a href="https://huggingface.co/Qwen/Qwen3-14B">qwen3:14b</a> (Alibaba's Qwen 3
with 14 billion parameters)</li>
  <li><a href="https://ollama.com/library/mathstral:7b">mathstral:7b</a> (Mistral AI's
mathstral with 7 billion parameters)</li>
  <li><a href="https://huggingface.co/google/medgemma-4b-it">medgemma:4b-it-bf16</a>
(Google's medgemma instruction-tuned model with 4 billion parameters)</li>
</ul>

<p>I chose the above since they are a few of them suitable to run on my
Laptop which has 32 GB of main memory and no GPU. Considering the amount
of training data and the CPU/GPU resources needed to train these models,
the folks who publish the open weight models deserve a lot of
appreciation.</p>

<p>I would like to stress that it was not my intention to compare the
performances of these models.</p>

<h1 id="the-experiment">The experiment</h1>

<p>First, I decided to put myself in the shoes of a high school/college
student who is trying to solve some algebra and calculus problems. The
rationale is that these problems require a number of steps and precise
reasoning in each step that lead to the final solution. I thought they
might be good candidates to test how these LLMs come up with the
answers.</p>

<p>Secondly, I tested <code class="language-plaintext highlighter-rouge">medgemma</code> that was specifically trained on medical
data including medical images and x-rays. This LLM was posed with
typical questions that appear in Medical Board Examination taken by
practicing doctors and medical residents. Again, many of the answers
require a fair amount of reasoning.</p>

<p>For testing <code class="language-plaintext highlighter-rouge">medgemma</code>,
<a href="https://rfimp.acpmresources.org/board-prep-resources/">MKSAP</a> questions
were taken from <a href="https://www.missouriacp.org/uploads/6/9/1/3/69139257/acpmo_mksap_mcqs_sept2023_pk_ir_final.pdf">this
file.</a></p>

<h1 id="key-takeaways">Key takeaways</h1>

<ul>
  <li>I am quite impressed by the fact that terabytes of training data is
locked into these models which take up only a few GB of memory. In
simple terms, this is possible because the sum total of memory used
for the dictionary of words, the parameters (weights), and the context
is only a few GB. Myriads of text can be generated algorithmically
(albeit non-deterministically) by using the neural network of the
model. Starting with various input contexts, it is possible to unlock
the training data from these models.</li>
  <li>The floating point precision of the weights can be decreased
(<a href="https://huggingface.co/docs/optimum/concept_guides/quantization">quantization</a>)
without sacrificing the performance of the LLM significantly. This
reduces the main memory footprint.</li>
  <li>The models run somewhat slower when there is no GPU (like my Laptop.)
For most of the problems, all CPU cores were fired up with each CPU
utilization in the range of 50% to 100%. The CPU cooling fan was
continuously running.</li>
  <li>The models generate <a href="https://en.wikipedia.org/wiki/Markdown">markdown</a>
output. Interestingly, the mathematical expressions are formatted in
<a href="https://en.wikipedia.org/wiki/LaTeX">LaTex</a> math. They accept LaTex
formatted math in the input as well.</li>
  <li>Some of the symbolic mathematical operations took excessive CPU time.
Perhaps, one can complement the LLMs with <a href="https://modelcontextprotocol.io/docs/2026-07-28/getting-started/intro">Model Context Protocol
(MCP)</a>
to invoke <a href="https://www.sympy.org/en/index.html"><code class="language-plaintext highlighter-rouge">sympy</code></a> for symbolic
math problems. I opted to take a shortcut and used <a href="https://docs.ollama.com/capabilities/tool-calling">function
calls</a> instead of
MCP to invoke some <code class="language-plaintext highlighter-rouge">sympy</code> functions. The use of <code class="language-plaintext highlighter-rouge">sympy</code> as an
external tool helped reduce the CPU time in some cases. It should be
noted that <code class="language-plaintext highlighter-rouge">mathstral</code> does not support function calls.</li>
  <li>Most of the math problems were answered correctly by the LLMs. For one
problem, the LLMs were struggling to come up with a definite answer.
When run multiple times, the answers were different (perhaps due to
<a href="https://en.wikipedia.org/wiki/Hallucination_(artificial_intelligence)">hallucination</a>
?) For LLMs which support function calling, <code class="language-plaintext highlighter-rouge">sympy</code> came to the rescue
except in one case where <code class="language-plaintext highlighter-rouge">qwen</code> passed the argument to the function
incorrectly and failed.</li>
  <li><code class="language-plaintext highlighter-rouge">medgemma</code> was able to answer only a fraction (14 out of 25) of the
questions correctly. Perhaps, models with more parameters may yield
better performance.</li>
  <li>Specialized LLMs ran faster than generic ones. For example,
<code class="language-plaintext highlighter-rouge">mathstral</code> consistently ran faster than <code class="language-plaintext highlighter-rouge">gemma</code> and <code class="language-plaintext highlighter-rouge">qwen</code> since it
was trained mostly on mathematical data. Similarly, for the same
question "What is the amount of calcium in one cup of milk?"
<code class="language-plaintext highlighter-rouge">medgemma</code> was able to answer faster than <code class="language-plaintext highlighter-rouge">gemma</code> (52 sec. versus 3
min. 23 sec. on my Laptop.)</li>
</ul>

<p>If you are interested in the details of the experiment, you can look at
my <a href="https://github.com/masokan/open-weight-llm-expt">github repository.</a></p>

<h1 id="conclusion">Conclusion</h1>

<p>Looking at the responses from the LLMs, it appears that all these models
are not reasoning like a real human being. They seem to try
non-deterministically different paths and verify that the answers are
the same. In case there is a function that can be called, they try to
take that path. As of now, for all these LLMs, human in the loop is
necessary to validate the answers or make any critical decisions.</p>

<p>The open weight models open up a plethora of possibilities. Some of the
models can be installed even on cell phones. Individual developers can
create AI agents that run locally on user devices without sharing any
private data with other entities. For example, see
<a href="https://developer.android.com/blog/posts/gemma-4-the-new-standard-for-local-agentic-intelligence-on-android">this</a>
and <a href="https://itsfoss.com/android-on-device-ai/">this</a> blog articles.
Coding agents are built using local models. For example, see
<a href="https://magazine.sebastianraschka.com/p/using-local-coding-agents">this</a>
article.</p>

<p>Companies that are concerned about tokenmaxxing may shift to open weight
models to cut down cost. For example, <a href="https://valueaddvc.com/pulse/att-open-source-models-anthropic-bills-2026">AT &amp; T is shifting to open weight
models.</a></p>]]></content><author><name></name></author><summary type="html"><![CDATA[Introduction]]></summary></entry><entry><title type="html">Vibe Coding - an experiment and some thoughts</title><link href="https://masokan.github.io/2026/04/28/vibe-coding-experiment.html" rel="alternate" type="text/html" title="Vibe Coding - an experiment and some thoughts" /><published>2026-04-28T00:00:00+00:00</published><updated>2026-04-28T00:00:00+00:00</updated><id>https://masokan.github.io/2026/04/28/vibe-coding-experiment</id><content type="html" xml:base="https://masokan.github.io/2026/04/28/vibe-coding-experiment.html"><![CDATA[<p>Here is an article I wrote in Linkedin about my experiment with Vibe
Coding: <a href="https://www.linkedin.com/pulse/vibe-coding-experiment-some-thoughts-mariappan-asokan-alw7e">Vibe Coding - an experiment and some
thoughts</a></p>]]></content><author><name></name></author><summary type="html"><![CDATA[Here is an article I wrote in Linkedin about my experiment with Vibe Coding: Vibe Coding - an experiment and some thoughts]]></summary></entry></feed>