<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by S Kunal Achintya Reddy on Medium]]></title>
        <description><![CDATA[Stories by S Kunal Achintya Reddy on Medium]]></description>
        <link>https://medium.com/@kunalachintya?source=rss-1f8a694c5c65------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9hd5UftQmG2qokEGsvXOiw.png</url>
            <title>Stories by S Kunal Achintya Reddy on Medium</title>
            <link>https://medium.com/@kunalachintya?source=rss-1f8a694c5c65------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:10:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kunalachintya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fewer LPs, longer raises: a 2026 evidence review of GP top-of-funnel, and how Otto changes the…]]></title>
            <link>https://medium.com/@kunalachintya/fewer-lps-longer-raises-a-2026-evidence-review-of-gp-top-of-funnel-and-how-otto-changes-the-6129205ce15e?source=rss-1f8a694c5c65------2</link>
            <guid isPermaLink="false">https://medium.com/p/6129205ce15e</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[fundraising]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[private-equity]]></category>
            <category><![CDATA[venture-capital]]></category>
            <dc:creator><![CDATA[S Kunal Achintya Reddy]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 10:35:57 GMT</pubDate>
            <atom:updated>2026-11-23T10:35:57.036Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fewer LPs, longer raises: a 2026 evidence review of GP top-of-funnel, and how Otto changes the arithmetic</h3><p>In 2026 the LP tools GPs rely on describe where capital has been, while capital itself is concentrating with incumbents. We reviewed the current evidence on six top-of-funnel methods and found no independent, LP-specific benchmark for any of them. We propose a method with three constraints: every LP record carries its source, date and confidence; every outreach claim is checked against the fund’s own facts; and a person approves each step. Under stated assumptions we project that this lowers the outreach needed for 20 commitments from about 667 LP contacts to about 483 in the base case. That is a projection, not a measured result; section 5 sets out how we will report actuals.</p><h3>1. What the 2026 evidence supports</h3><p>Capital is available, but it is going to managers LPs already know, so a GP’s top of funnel is a precision problem rather than a reach problem.</p><p>The ten largest PE funds to close in Q1 2026 took more than half of the $90.9 billion raised, against a decade average of 26.8%, and rolling-12-month fundraising fell for an eighth straight quarter to about $385 billion (<a href="https://finance.yahoo.com/markets/stocks/articles/pes-capital-concentration-phenomenon-reaches-203533997.html">PitchBook, via Yahoo Finance</a>). Goldman Sachs surveyed 225 LPs between June and August 2026: 84% plan to deploy the same or more, but capital is concentrating with incumbents, and for new managers track record matters most (78%), ahead of access to new strategies (50%), specialist expertise (39%) and diversification (35%) (<a href="https://am.gs.com/en-us/institutions/news/press-release/2026/goldman-sachs-survey-lps-hold-steady-on-private-markets-as-distributions-lag">Goldman Sachs Alternatives</a>). Lack of distributions is the top constraint on deployment at 35%, up from 31%. On the GP side, 71% now cite difficulty securing LP commitments, up from 50% in 2025 (<a href="https://www.dynamosoftware.com/blog/the-2026-gp-survey-ai-first-fundraising-resilient/">Dynamo Software</a>), yet 73% still expect to launch a fund within a year (<a href="https://www.dynamosoftware.com/blog/general-partner-alts-environment/">Dynamo</a>). Of funds that closed in H1 2026, 30% reached final close within six months and about 27% took more than 24 (<a href="https://www.spglobal.com/market-intelligence/en/news-insights/articles/2026/7/buyout-funds-attract-bulk-of-306-8b-raised-by-pe-managers-through-june-30-103636548">With Intelligence, S&amp;P Global</a>).</p><p>Six top-of-funnel methods are in use. Each is set against the best evidence we could find and where that evidence stops.</p><ul><li><strong>Static LP databases.</strong> An S&amp;P Global GP survey (Feb 2026) found about 60% of GPs dissatisfied with access to LP allocation and mandate information, and over 50% short of intelligence on peer fundraising (<a href="https://alpha-maven.com/story/private-equity/private-markets-gps-reveal-fundraising-optimism-for-2026-shifting-lp-priorities-are-main-challenge-altassets-private-equity-news">AltAssets recap</a>). Where it stops: recap only; claims of 60 to 180 day refresh cycles come from a competing vendor (<a href="https://altss.com/blog/best-investor-lp-databases-in-2025.md">Altss</a>) and are unverified.</li><li><strong>Placement agents.</strong> 344 of 2,760 funds closed through Q4 2022 used one. Agent-backed funds closed in 15.4 months in 2017 against 26.4 without; by 2021 the order reversed, 18.6 against 16.6 (<a href="https://files.pitchbook.com/website/files/pdf/Q1_2023_PitchBook_Analyst_Note_The_Role_of_Placement_Agents_in_GP_Fundraising.pdf">PitchBook</a>). Where it stops: success fees of at least 2% for first-time funds, and some agents decline first-time funds; data ends in 2021 to 2022.</li><li><strong>Incumbent and warm relationships.</strong> LPs concentrate commitments with existing GPs (Goldman Sachs, above). Where it stops: it says which LPs favour incumbents, not which relationships to activate or when.</li><li><strong>Autonomous AI outbound.</strong> Vendor roundups (Autobound, a sales-prospecting platform, and Digital Applied) report per-rep volume up from 1,150 to 7,400 messages a month while raw reply rates fell from 4.7% to 2.9%, and cost per qualified opportunity from $487 to $224 for hybrid teams (<a href="https://overloop.com/blog/ai-prospecting-statistics">Overloop, citing Autobound and Digital Applied</a>). Where it stops: B2B sales samples, not LPs; one widely repeated version of these figures gives no sample or dates, so treat them as directional.</li><li><strong>Signal-triggered outreach.</strong> Unify, which sells signal-based outbound, reports 73% more replies than cold outbound (<a href="https://www.unifygtm.com/explore/ai-sdr-performance-metrics">Unify</a>). Where it stops: self-reported by a vendor selling it; no independent LP test found.</li><li><strong>Public visibility (Rule 506(c)).</strong> 506(b) prohibits general solicitation and needs substantive pre-existing relationships; 506(c) allows open marketing if accredited status is verified (<a href="https://digify.com/blog/pvt-equity-fundraising-agents-digital-marketing/">Digify</a>); most emerging managers raise under 506(b) per one fund-marketing firm (<a href="https://pipelineroad.com/fund-marketing">PipelineRoad</a>). Where it stops: US-only; verification burden; NBER work on the exemption choice presumes weak-network managers lean on 506(c) (<a href="https://www.nber.org/system/files/working_papers/w33080/w33080.pdf">NBER</a>).</li></ul><p>Two patterns matter for what follows. First, the only before-and-after series in the set, placement agents, shows an advantage disappearing once information got cheaper: PitchBook attributes the reversal to LPs becoming comfortable with online diligence. A channel built on access to information decays. Second, every claim about AI or signal-based outreach comes from a vendor or from sales data outside this market. We found no independent, LP-specific benchmark.</p><h3>2. What the evidence leaves open</h3><p>Four gaps separate what a GP can buy today from what a raise needs.</p><ol><li><strong>Provenance.</strong> Nothing in the reviewed methods shows why an LP is on a list or how old that fact is. With about 60% of GPs unhappy with their access to LP mandate information, an undated record is a cost, not an asset.</li><li><strong>Claims LPs can check.</strong> New managers are judged first on track record (78% of LPs in the Goldman Sachs survey). Outreach that overstates or invents a credential fails the first test, and generated copy is where that risk sits.</li><li><strong>Compliant automation.</strong> Volume is the wrong lever where general solicitation is restricted. Practitioner guidance is blunt that a tool emailing a purchased list about a fund is solicitation (<a href="https://christopholivierconsulting.com/ai-tools-for-fund-manager-marketing/">Christoph Olivier Consulting</a>); EU and UK recipients add consent requirements.</li><li><strong>A baseline to beat.</strong> The funnel most fundraising guides quote comes from vendors, here Praxis Rock, a fund-marketing firm that sells outreach services: roughly 100 LP contacts to 20 to 30 meetings, 5 to 10 serious prospects and 2 to 4 commitments for a first-time manager (<a href="https://praxisrock.com/fundraising/vs-placement-agent">Praxis Rock</a>), and 150 to 300 LP interactions to close 15 to 40 commitments (<a href="https://praxisrock.com/insights/pe-fundraising-complete-guide">Praxis Rock</a>). Useful as planning heuristics, but the pages we read state no sample or method, and we could not verify them.</li></ol><p>The method below targets gaps 1 to 3 directly, and section 4 uses the heuristic in gap 4 as the baseline to project against.</p><h3>3. The proposed method</h3><p>Otto v1 is designed around one rule for gaps 1 to 3: nothing is a claim until it is a fact, and nothing is sent until a person approves it. It is aimed first at first-time managers, and the settings below describe v1 as built today.</p><ul><li><strong>Fact base first.</strong> The GP enters strategy, sectors, target size, ticket range, track record, team and key facts. Drafts are checked against it, and only the key facts entered there are meant to appear as claims.</li><li><strong>Shortlist as scored fit.</strong> LPs are scored against the fund’s strategy, stage, sectors, geography and ticket size, and every LP record shows its source, date and confidence.</li><li><strong>A human gate with hard limits.</strong> Otto drafts; you approve every message. Email only, an opt-out line in every message, at most 10 an hour, a consent check for EU and UK recipients before sending, and no LinkedIn automation.</li><li><strong>Compliance tracked, not claimed.</strong> A 21-item materials checklist flags what counsel must decide, including fund-marketing advice per target country, the data-protection notice and the opt-out wording. Otto tracks these; counsel decides.</li><li><strong>Context for timing.</strong> Competitor Watch follows competing-fund and portfolio-competitor moves, and the dashboard summarises new pooled-fund Form D filings and fund closes over 30 days.</li></ul><p>The flow has four steps: a fact base, a shortlist scored against it, your approval of every draft, and a booked meeting tracked through target, warm+, meeting+ and soft commit+. Fund data stays in your browser, isolated per GP and never pooled.</p><p>The 10-an-hour cap is not the bottleneck: even 667 contacts is under 70 hours of sending. Approval attention is, which is why the shortlist’s job is to put the best-fit LPs first.</p><h3>4. Projected performance (not measured)</h3><p>On stated assumptions, Otto cuts the outreach needed for 20 commitments from about 667 LP contacts to between 606 and 395; the base case is 483, a 28% reduction. These are projections from the assumptions below, not measured Otto results.</p><p>The baseline is the midpoint of Praxis Rock’s vendor-reported heuristic (section 2): per 100 contacts, 25 meetings, of which 30% become serious prospects, of which 40% commit, giving 3 commitments. Otto is assumed to move two levers: the contact-to-meeting rate, through better-fit and fresher targets, and the serious-to-commitment rate, through mandate fit and claims that survive diligence.</p><p>Commitments per 100 contacts = 100 × m × s × c, where m is the meeting rate (25%), s the serious-prospect share of meetings (30%) and c the commitment share of serious prospects (40%). Lifts below are relative changes to m and c; s is held fixed.</p><ul><li><strong>Baseline:</strong> 3.0 commitments per 100 contacts; 667 contacts for 20 commitments.</li><li><strong>Conservative</strong> (m +10%, c unchanged): 3.3 per 100; 606 contacts, 9% fewer.</li><li><strong>Base</strong> (m +20%, c +15%): 4.1 per 100; 483 contacts, 28% fewer.</li><li><strong>Optimistic</strong> (m +35%, c +25%): 5.1 per 100; 395 contacts, 41% fewer.</li></ul><p>In the base case, 100 contacts become 30 meetings, 9 serious prospects and about 4.1 commitments, against 25, 7.5 and 3 at baseline. The lifts are our assumptions. We kept the optimistic meeting-rate lift at roughly half the one published figure for signal-led outreach (73% more replies, vendor-reported), because replies are not meetings and no LP-specific test exists.</p><p>The case fails if measured results come in below the conservative row. A meeting-rate lift under 10% with no change in commitments would mean the shortlist is not out-performing a good manual list.</p><h3>5. How we will report actuals</h3><p>One first-time raise cannot prove the lift, so actuals will be reported across pilot funds, with endpoints and stopping rules fixed before the first message is sent.</p><p>The sample-size arithmetic drives the design (two-sided test, 5% significance, 80% power). Detecting a meeting rate moving from 25% to 30% takes about 1,251 contacts per arm; from 25% to 33.75%, about 425 per arm. Detecting commitments per contact moving from 3.0% to 4.14% takes about 4,158 per arm. A single raise of roughly 667 contacts is underpowered for the first test and cannot support the second, so meetings per contact is the primary endpoint and commitments are reported with intervals, not tested.</p><ul><li><strong>Unit:</strong> one named LP contact; no LP appears in both arms.</li><li><strong>Arms:</strong> A is the GP’s own list and process. B is Otto’s shortlist order and drafts, every message human-approved. Randomised within strata of LP type and region.</li><li><strong>Primary endpoint:</strong> booked meetings per contact within 60 days of the first approved message.</li><li><strong>Secondary endpoints:</strong> serious prospects and soft commits per contact (the pipeline stages Otto tracks), GP hours per meeting, bounce and opt-out rates.</li><li><strong>Sample:</strong> pool pilot funds until at least 425 contacts per arm; report effect sizes with intervals.</li><li><strong>Guardrails:</strong> identical in both arms: email only, opt-out line, consent check, counsel sign-off before launch.</li><li><strong>Reporting:</strong> publish the result whatever it is, including any outcome below the conservative row, with the definitions used.</li></ul><p>Randomising inside one raise is imperfect: LPs talk to each other, and a GP’s attention shifts toward the arm that is working. We will state that limit with the results.</p><h3>6. Limits and sources</h3><ul><li>The baseline funnel is a vendor heuristic for first-time managers; established managers convert differently.</li><li>The lifts in section 4 are assumptions, and the model holds the serious-prospect share fixed.</li><li>Most of the AI-outreach evidence is vendor-published or comes from B2B sales, not LP markets.</li><li>Compliance discussion uses the US Rule 506(b) and 506(c) framework; other jurisdictions differ and this is not legal advice. Otto’s own checklist assigns these questions to counsel.</li><li>The product description reflects Otto v1 as of 23 November 2026 and describes designed behaviour; we have not independently audited how the guardrails perform, and settings may change.</li></ul><p>Sources opened in full: <a href="https://am.gs.com/en-us/institutions/news/press-release/2026/goldman-sachs-survey-lps-hold-steady-on-private-markets-as-distributions-lag">Goldman Sachs Alternatives 2026 LP survey</a>; <a href="https://finance.yahoo.com/markets/stocks/articles/pes-capital-concentration-phenomenon-reaches-203533997.html">PitchBook Q1 2026 fundraising figures</a>; <a href="https://files.pitchbook.com/website/files/pdf/Q1_2023_PitchBook_Analyst_Note_The_Role_of_Placement_Agents_in_GP_Fundraising.pdf">PitchBook placement-agent note</a>. Figures taken from search-result summaries only: Dynamo Software 2026 GP survey; With Intelligence (S&amp;P Global) H1 2026; the AltAssets recap; Altss; Overloop; Unify; Digify; PipelineRoad; Christoph Olivier Consulting; NBER w33080; Praxis Rock. All are linked above.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6129205ce15e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fine-Tuning Large Language Models (LLMs): The Complete Easy Guide]]></title>
            <link>https://medium.com/@kunalachintya/fine-tuning-large-language-models-llms-the-complete-easy-guide-aea360f92022?source=rss-1f8a694c5c65------2</link>
            <guid isPermaLink="false">https://medium.com/p/aea360f92022</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[for-begginers]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <dc:creator><![CDATA[S Kunal Achintya Reddy]]></dc:creator>
            <pubDate>Fri, 10 Oct 2025 20:38:53 GMT</pubDate>
            <atom:updated>2025-10-10T20:38:53.055Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Fine-Tuning?</h3><blockquote><em>Fine-tuning = Taking a pre-trained model and training it a bit more on </em>specific data<em> to make it better for </em>specific tasks<em>.</em></blockquote><ul><li><strong>Analogy:</strong> You learn general English (pretraining), then practice medical English (finetuning).</li><li><strong>Goal:</strong> Make LLMs adapt to your <strong>domain</strong>, <strong>style</strong>, or <strong>task</strong> without training from scratch.</li></ul><h3>Think of it like this:</h3><blockquote><em>You already know English (pretrained model).<br> Now, you learn </em><strong><em>medical English</em></strong><em> (fine-tuned model).</em></blockquote><p>It doesn’t start from scratch — it <strong>builds on existing knowledge</strong>, saving time and compute.</p><h3>Types of Fine-Tuning</h3><p><strong>1.Full Fine-Tuning</strong><br> You update <strong>all the model’s weights</strong> (parameters).<br> It gives high accuracy but needs <strong>huge GPU power and memory</strong>.</p><p><strong>2. LoRA Fine-Tuning</strong><br> Only small parts (called “adapters”) of the model are trained, while the rest are <strong>frozen</strong>.<br> This saves compute and memory.</p><p><strong>3. QLoRA Fine-Tuning</strong><br> Same idea as LoRA, but even more efficient — it first <strong>compresses (quantizes)</strong> the model into 4-bit precision before training.<br> This allows huge models (like 65B or 70B) to fit into a single GPU.</p><p><strong>4. Prompt Tuning / Prefix Tuning</strong><br> Instead of modifying the model, you learn only <strong>a few tokens or prompts</strong> that guide how it behaves.<br> It’s super lightweight and ideal for very small customizations.</p><p><strong>4. Instruction Tuning</strong><br> The model is trained on datasets that look like human instructions and responses.<br> This makes it good at following commands — like ChatGPT.</p><p><strong>5. RLHF (Reinforcement Learning from Human Feedback)</strong><br> The model generates outputs, humans rate them, and the model is tuned to produce preferred responses.<br> This aligns models with human values and preferences.</p><h3>LoRA vs QLoRA (Simple Words)</h3><p><strong>LoRA (Low-Rank Adaptation)</strong><br> It adds small trainable layers inside the model. The base model stays frozen, only these layers get updated.</p><p><strong>QLoRA (Quantized LoRA)</strong><br> Same LoRA method, but before training, the base model is <strong>quantized</strong> (compressed to 4-bit precision).<br> That means you can train very large models on limited hardware (even a single consumer GPU).</p><p>LoRA = Efficient fine-tuning.<br>QLoRA = Ultra-efficient fine-tuning.</p><h3>What Are “Parameters”?</h3><p>Parameters are <strong>the learned weights of the neural network</strong> — millions or billions of tiny numbers that define how the model behaves.<br> Each connection between neurons has a weight, and these weights together form the model’s intelligence.</p><p>When you hear:</p><blockquote><em>“An 80 billion parameter model”<br> It means the model has </em><strong><em>80 billion learnable weights</em></strong><em> — 80 billion small floating-point numbers that capture its knowledge about language.</em></blockquote><p>🧠 More parameters = more capacity and understanding.<br> 💻 But also = more memory and slower inference.</p><h3>Key Components in Fine-Tuning</h3><ul><li><strong>Base Model:</strong><br> The pre-trained LLM you start with (like LLaMA, GPT, Mistral).</li><li><strong>Tokenizer:</strong><br> Converts text into smaller units called tokens.<br> Example: “Fine-tuning is fun!” → [“Fine”, “-”, “tuning”, “is”, “fun”, “!”]</li><li><strong>Training Data:</strong><br> Task-specific examples like prompt → response pairs.</li><li><strong>Batch Size:</strong><br> How many samples the model sees at once during training.</li><li><strong>Learning Rate:</strong><br> Controls how much to adjust weights after each update.<br> Too high → unstable,<br> Too low → slow learning.</li><li><strong>Epoch:</strong><br> One full pass through your dataset.</li><li><strong>Steps:</strong><br> Number of individual updates (mini batches).</li><li><strong>Optimizer:</strong><br> The algorithm that adjusts the weights, commonly AdamW.</li><li><strong>Loss Function:</strong><br> Measures how wrong the model’s prediction was.<br> Lower loss = better learning.</li><li><strong>Validation Loss:</strong><br> Checks if the model is overfitting (memorizing training data).</li><li><strong>Checkpoint:</strong><br> A saved snapshot of your model’s weights during training.</li></ul><h3>What Happens During Fine-Tuning</h3><ol><li>The base pre-trained model (e.g., LLaMA-2–7B) is loaded.</li><li>Most weights are frozen — only small adapter layers (LoRA) are trainable.</li><li>The dataset (prompts and responses) is tokenized and fed to the model.</li><li>The model predicts tokens → loss is calculated → adapter weights are updated.</li><li>The process repeats for many batches and epochs.</li><li>Finally, the small adapter weights are saved (few MBs instead of GBs).</li><li>During inference, you load the base model + adapter weights together.</li></ol><h3>What Each Part Does in the Process</h3><ul><li><strong>Frozen Base Model:</strong> acts as a knowledge foundation.</li><li><strong>Adapters (LoRA):</strong> small plug-ins that learn task-specific behavior.</li><li><strong>Quantization (QLoRA):</strong> compresses model weights to fit memory.</li><li><strong>Optimizer:</strong> ensures smooth updates.</li><li><strong>Loss Function:</strong> checks correctness at each step.</li><li><strong>Checkpoints:</strong> help resume or rollback training anytime.</li></ul><h3>Choosing What to Fine-Tune</h3><ul><li>If your goal is a <strong>domain-specific chatbot</strong> (like legal, medical, or education): use <strong>instruction fine-tuning with LoRA</strong>.</li><li>For <strong>code generation or reasoning</strong>, use <strong>QLoRA</strong> for larger models.</li><li>For <strong>classification tasks</strong> (like sentiment analysis), add a classifier head.</li><li>For <strong>evaluation or grading systems</strong>, fine-tune using QLoRA on labeled answer data.</li></ul><h3>How to Know It’s Working (Evaluation Metrics)</h3><ul><li><strong>Loss:</strong><br> The most direct measure — if it’s decreasing, the model is learning.</li><li><strong>Perplexity:</strong><br> Lower means better text prediction.</li><li><strong>Accuracy, F1-score:</strong><br> Used for tasks with labels (e.g., classification).</li><li><strong>BLEU, ROUGE:</strong><br> Used for summarization or translation to check text overlap.</li><li><strong>Human Evaluation / GPT Eval:</strong><br> The best metric — human judgment on quality and relevance.</li></ul><h3>Hardware Simplified</h3><ul><li>If you have a small GPU (8GB): fine-tune small models (3B–7B) with <strong>QLoRA (4-bit)</strong>.</li><li>With 24GB GPU: train mid-sized models (13B) easily.</li><li>48GB+ GPUs: suitable for large models (30B–70B).</li><li>Multiple GPUs or TPUs: for very large industrial-scale fine-tuning.</li></ul><p>💡 <strong>QLoRA is designed so you can fine-tune 65B+ models on a single GPU</strong>.</p><h3>Important Terms You Should Remember</h3><ul><li><strong>Parameter:</strong> a weight inside the neural net.</li><li><strong>Gradient:</strong> tells how much each weight should change.</li><li><strong>Backpropagation:</strong> process of updating weights.</li><li><strong>Overfitting:</strong> when the model memorizes training data instead of learning.</li><li><strong>Regularization:</strong> techniques (like dropout or L2) to prevent overfitting.</li><li><strong>Learning Rate Scheduler:</strong> automatically adjusts LR during training.</li><li><strong>Epoch:</strong> one complete study cycle.</li><li><strong>Checkpoint:</strong> saved progress to avoid losing training work.</li></ul><h3>Sample Code Block</h3><pre>from transformers import AutoModelForCausalLM, AutoTokenizer<br>from peft import LoraConfig, get_peft_model<br><br># Load base model<br>model = AutoModelForCausalLM.from_pretrained(&quot;meta-llama/Llama-2-7b&quot;)<br>tokenizer = AutoTokenizer.from_pretrained(&quot;meta-llama/Llama-2-7b&quot;)<br><br># Configure LoRA<br>config = LoraConfig(<br>    r=8,              # low-rank dimension<br>    lora_alpha=32,    # scaling factor<br>    lora_dropout=0.1, # dropout to prevent overfitting<br>)<br><br># Apply LoRA adapters<br>model = get_peft_model(model, config)<br><br># Train the model with your custom dataset here<br># ...<br><br># Save adapter weights<br>model.save_pretrained(&quot;llama2-lora-finetuned&quot;)</pre><h3>Quick Recap (Memory Hooks)</h3><ul><li>Fine-tuning = specialized learning.</li><li>LoRA = train a few small layers.</li><li>QLoRA = compress + train few layers.</li><li>Parameters = model’s knowledge.</li><li>80B params = 80 billion learned numbers (80 billion dimensions of learning relations.</li><li>Epoch = one full data pass.</li><li>Learning rate = how fast model learns.</li><li>Checkpoint = saved progress.</li><li>Overfitting = memorization trap.</li><li>Adapters = plug-in intelligence modules.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aea360f92022" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Student’s Guide to Large Language Models (LLMs) and Prompt Tuning with Ollama and Phi3]]></title>
            <link>https://medium.com/@kunalachintya/a-students-guide-to-large-language-models-llms-and-prompt-tuning-with-ollama-and-phi3-98457d9a7b31?source=rss-1f8a694c5c65------2</link>
            <guid isPermaLink="false">https://medium.com/p/98457d9a7b31</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[phi-3]]></category>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[S Kunal Achintya Reddy]]></dc:creator>
            <pubDate>Thu, 14 Nov 2024 20:13:13 GMT</pubDate>
            <atom:updated>2024-11-14T20:13:13.080Z</atom:updated>
            <content:encoded><![CDATA[<p>With the rise of AI and machine learning, Large Language Models (LLMs) have become a hot topic. They’re widely used in chatbots, content generation, and personalized learning assistants. This blog will guide you through understanding LLMs, setting up Ollama, installing the phi3 model, exploring key parameters, and customizing the model to suit your needs.</p><h3>1. What Are Large Language Models (LLMs)?</h3><p>Large Language Models (LLMs) are AI systems trained on massive amounts of text data. They can generate human-like responses, summarize text, answer questions, and much more. Popular models like ChatGPT, GPT-3, and OpenAI’s Codex are examples of LLMs. Each LLM has its strengths, and prompt tuning them can yield great results for specific needs, from tutoring to creating chatbots.</p><h3>Why Use LLMs?</h3><ul><li><strong>Learning Assistants</strong>: They’re great for answering questions and guiding through problems.</li><li><strong>Content Creation</strong>: Ideal for writing help, brainstorming, and even project ideation.</li><li><strong>Chatbots and Assistants</strong>: You can create your personalized AI bot using these models.</li></ul><h3>2. Setting Up Ollama</h3><p>Ollama is a framework that allows you to work with LLMs, and it’s designed for both beginners and experienced users. You can install and manage various models on your local machine or cloud environments. Here’s how to get started with Ollama:</p><h3>Step-by-Step Ollama Installation</h3><ol><li><strong>Download Ollama</strong>: Visit the <a href="https://ollama.com/">Ollama website</a> to download the installer for your operating system.</li><li><strong>Install Ollama</strong>: Follow the on-screen instructions based on your OS to complete the installation.</li><li><strong>Verify Installation</strong>: Once installed, open your command prompt or terminal and type</li></ol><pre>ollama --version</pre><h3>3. Installing the Phi3 Model in Ollama</h3><p>The phi3 model is one of the versatile models available in Ollama, suitable for general-purpose tasks like tutoring, chatbots, and Q&amp;A systems. Here’s how to install it:</p><ol><li><strong>Download the Phi3 Model</strong>:</li></ol><p>In your terminal, use:</p><pre>ollama pull phi3</pre><p>This command downloads and sets up the phi3 model on your system.</p><p>2.<strong> Confirm Installation</strong>:</p><p>Check if the model is installed by running:</p><pre>ollama list</pre><p>This should display the installed models, including phi3.</p><h3>4. Understanding Parameters in Ollama’s Modelfile</h3><ol><li>Once you have the phi3 model installed, you can configure it by using a Modelfile. This file defines model parameters, templates, and response behaviors. To find the model file of a model, which in this case is phi3 you will have to the run the below command in the terminal :</li></ol><pre>ollama show --modelfile phi3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXl42ruTTN0lmib7zEILfA.png" /><figcaption>This is how it displays when you type in the command</figcaption></figure><p>2. Now, copy the path shown there after the word FROM — <em>C:\Users\kunal\.ollama\models\blobs\</em></p><p>Don’t copy the Sha256 coded string, now you can paste that in your file manager to navigate to the specific folder where all the model files and configurations for the phi3 model are stored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TkeYMSXAQS21hwHt-sr7Yg.png" /><figcaption>File manager how it looks after pasting in the path</figcaption></figure><p>3. Now, you should create a new text file and name it as Modelfile.txt .</p><p>4. Once that is done, you can open that file and <em>fine tune </em>model according to your needs by experimenting with the parameters : -</p><p>Here’s a breakdown of key parameters:</p><h3>1. FROM</h3><p><strong>FROM</strong>: Specifies the model file path. For example, the phi3 model</p><pre>FROM phi3</pre><p>Currently supported model architectures:</p><ul><li>Llama (including Llama 2, Llama 3, Llama 3.1, and Llama 3.2)</li><li>Mistral (including Mistral 1, Mistral 2, and Mixtral)</li><li>Gemma (including Gemma 1 and Gemma 2)</li><li>Phi3</li></ul><p>But, before importing using the FROM keyword you should download the model using :</p><pre>ollama pull model_name</pre><h3>2. PARAMETER</h3><p>The PARAMETER instruction defines a parameter that can be set when the model is run.</p><pre>PARAMETER &lt;parameter&gt; &lt;parametervalue&gt;</pre><p>That’s the syntax for importing a base model and then defining and configuring various parameters without actually hard-coding. Now we will learn about the various parameters and how they effect the model’s performance.</p><ol><li><strong>Mirostat</strong>: Enables Mirostat sampling for controlling perplexity. By default, this is set to 0, which means it’s disabled. Setting it to 1 enables Mirostat, while 2 enables Mirostat 2.0.</li></ol><ul><li><strong>Example</strong>: mirostat 0</li></ul><p>2. <strong>Mirostat Eta</strong>: Influences the speed of the algorithm’s response to feedback from the generated text. Lower values slow down adjustments, while higher values make it more responsive. The default is 0.1.</p><ul><li><strong>Example</strong>: mirostat_eta 0.1</li></ul><p>3. <strong>Mirostat Tau</strong>: Controls the balance between coherence and diversity of output. A lower value results in more focused and coherent text, while a higher value introduces more variety. Default is set to 5.0.</p><ul><li><strong>Example</strong>: mirostat_tau 5.0</li></ul><p>4. <strong>Num Ctx</strong>: Sets the context window size used to generate the next token. By default, this is set to 2048 tokens. Increasing this allows for longer contextual understanding.</p><ul><li><strong>Example</strong>: num_ctx 4096</li></ul><p>5. <strong>Repeat Last N</strong>: Determines how far back in the token sequence the model should look to prevent repetition. The default is 64. Setting it to 0 disables repetition checking, and -1 sets it to the entire context length (num_ctx).</p><ul><li><strong>Example</strong>: repeat_last_n 64</li></ul><p>6. <strong>Repeat Penalty</strong>: Adjusts how strongly the model is penalized for repeating the same text. Higher values (e.g., 1.5) penalize repetition more, while lower values are more lenient. The default setting is 1.1.</p><ul><li><strong>Example</strong>: repeat_penalty 1.1</li></ul><p>7. <strong>Temperature</strong>: Controls the model’s creativity in responses. Higher temperatures (above 1.0) yield more creative, varied responses, while lower temperatures produce more focused answers. The default is 0.8.</p><ul><li><strong>Example</strong>: temperature 0.7</li></ul><p>8. <strong>Seed</strong>: Sets the random seed for generation. Using a specific number for the seed ensures consistent generation results. By default, it is set to 0.</p><ul><li><strong>Example</strong>: seed 42</li></ul><p>and many more.</p><p>Example Modelfile.txt :</p><pre>FROM phi3<br><br>PARAMETER temperature 0.7<br>PARAMETER mirostat 2<br>PARAMETER mirostat_eta 0.1<br>PARAMETER seed 8<br>PARAMETER num_ctx 4096<br>PARAMETER repeat_last_n -1<br>PARAMETER repeat_penalty 1.5<br><br>SYSTEM &quot;&quot;&quot;Your name is Kunal, You are an AI assistant to generate code in python for a given user input and give a funny joke after the response&quot;&quot;&quot;</pre><p>Now, Save this file. Open the terminal in the same folder where your Modelfile.txt exists and type the following command :</p><pre>ollama create choose_a_name -f ./Modelfile</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BlAknrxvEFCpWV4X3MsZ3Q.png" /><figcaption>Your terminal should look like this after running the above command</figcaption></figure><p>Now, your fine-tuned model is ready to use, You can access it by running :</p><pre>ollama run your_model_name</pre><p>Suppose, if you want to access the local model through an API endpoint, by default on windows, first you will have to close the Ollama application in task manager to make sure it’s not running in the background.</p><p>Now, you can go to the terminal and type in :</p><pre>ollama serve</pre><p>to run the ollama server and then you can use this api endpoint to access your model and get responses :</p><pre>http://localhost:11434/api/generate #api endpoint</pre><pre>try:<br>        response = requests.post(<br>            &quot;http://localhost:11434/api/generate&quot;,<br>            json={&quot;model&quot;: &quot;flurry&quot;, &quot;prompt&quot;: message},<br>            stream=True<br>        )</pre><p>Here, port number 11434 is an default port that Ollama uses when it serves the local models.</p><p>Working with LLMs and tools like Ollama opens up many possibilities. By understanding how to install, configure, and tune models like phi3, you can build personalized AI experiences, from study aids to creative assistants.</p><p>Give these steps a try, and start experimenting with phi3 to see what your customized LLM can do for you!</p><p>Hope, this helps and you enjoyed learning something new. Do follow and like for more… 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98457d9a7b31" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>