<?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 José Antonio Mancilla Chatú on Medium]]></title>
        <description><![CDATA[Stories by José Antonio Mancilla Chatú on Medium]]></description>
        <link>https://medium.com/@jt.mancilla?source=rss-1ef2db76123------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aR3XIWLAEVcmXpPlHkjidw.png</url>
            <title>Stories by José Antonio Mancilla Chatú on Medium</title>
            <link>https://medium.com/@jt.mancilla?source=rss-1ef2db76123------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 13:15:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jt.mancilla/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[Beyond the Chatbot: A Postmortem on the Agentic AI Frontier]]></title>
            <link>https://medium.com/@jt.mancilla/beyond-the-chatbot-a-postmortem-on-the-agentic-ai-frontier-571b1464ba91?source=rss-1ef2db76123------2</link>
            <guid isPermaLink="false">https://medium.com/p/571b1464ba91</guid>
            <dc:creator><![CDATA[José Antonio Mancilla Chatú]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 22:38:56 GMT</pubDate>
            <atom:updated>2025-12-15T22:38:56.519Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oKOvkPC9nLU10d9zx1hhUQ.png" /><figcaption>Clay Bavor/ Sierra AI Agents</figcaption></figure><p>Over the past few months, I’ve been immersed in the <strong>Agentic AI MOOC (</strong><a href="https://agenticai-learning.org/f25">https://agenticai-learning.org/f25</a>), a deep dive into what many consider the next great paradigm shift in artificial intelligence. If the last cycle was defined by “chat” — models that predict the next token to satisfy a human user — this next cycle is defined by “agency” — models that take the next action to satisfy a verifiable objective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*05XJmjk236Qx3iM6EHdZrw.png" /><figcaption><strong>Agentic AI MOOC / UC Berkeley</strong></figcaption></figure><p>The curriculum was dense, featuring insights from leaders at OpenAI, NVIDIA, Sierra, and top research labs. Looking back, the journey wasn’t just about learning new algorithms; it was about unlearning the assumption that scaling parameters is the only path forward. Here are my core takeaways from the frontier of Agentic AI.</p><h3>1. The Shift from “User Preference” to “Verifiable Reward”</h3><p>The course opened with a fundamental distinction that set the tone for the entire semester. Yann Dubois (OpenAI) and Jiantao Jiao (NVIDIA) articulated the transition from traditional LLMs to Agentic Models.</p><p>Traditional chat models are trained to maximize <em>human preference</em> (RLHF) — they want to sound helpful and polite. However, agents interacting with a software environment don’t need to be polite; they need to be <em>correct</em>. Jiao introduced the concept of <strong>“Post-Training Verifiable Agents,”</strong> where the training objective shifts from satisfying a human grader to maximizing a verifiable reward from the environment (e.g., did the code compile? Did the math problem yield the correct integer?). This shift is profound because it moves us away from the subjectivity of conversation and toward the objectivity of execution.</p><h3>2. Infrastructure is the New “Third Pillar”</h3><p>We often obsess over model architecture, but Yangqing Jia (Lepton AI) reminded us that <strong>AI Infrastructure</strong> has become the “third pillar” of enterprise IT, alongside scientific computing and web services.</p><p>Building agents isn’t just about serving a model; it’s about managing complex, heterogeneous workflows. We learned that the “bitter lesson” of AI — that general methods leveraging computation eventually beat clever hand-designed heuristics — applies to agents too. The future belongs to systems that can scale inference-time compute, allowing agents to “think” (reason, plan, verify) before they act.</p><h3>3. The “Trust Gap” and the Noise Problem</h3><p>If we are to deploy agents that book flights or write software, evaluation cannot be an afterthought. The lecture on <strong>Agent Evaluation</strong> highlighted a critical taxonomy: static vs. dynamic, and verifiable vs. non-verifiable.</p><p>Sida Wang (Meta) presented a sobering look at <strong>“Predictable Noise,”</strong> showing how current benchmarks often fail to distinguish true capability from randomness. He demonstrated that on complex generative tasks, a model’s performance can fluctuate wildly based on the prompt or seed. The lesson? We need “signal-to-noise” ratios in our evaluations7. We can no longer rely on a single “pass@1” score; we need rigorous, statistically significant evaluations, especially when the cost of an agent making an error in the real world is non-zero.</p><h3>4. Training: The Wall Between Pre-training and Post-training</h3><p>Weizhu Chen (Microsoft) pulled back the curtain on the immense difficulty of training these models. While pre-training teaches a model “English,” post-training (SFT and RL) teaches it to be an “Agent”.</p><p>A key insight was the role of <strong>Data Synthesis</strong>. We are running out of high-quality human data, so the best agents are increasingly trained on data generated by other agents — specifically, “rationales” and execution traces that are verified by code or math engines9. The challenge now is <strong>“Test-Time Scaling”</strong> — allowing the model to think longer, generate multiple plans, and self-correct, effectively trading compute for intelligence.</p><h3>5. Agents in the Wild: Dual-Control and Scientific Discovery</h3><p>Perhaps the most inspiring modules were on application. Noam Brown (OpenAI) drew the analogy to AlphaGo, suggesting that <strong>Multi-Agent Self-Play</strong> is the path to recursive self-improvement. Just as AlphaGo learned by playing against itself, agents can learn by interacting with each other in simulated environments.</p><p>We saw this in action with James Zou’s (Stanford) work on <strong>“Paper2Agent”</strong> and the <strong>“Virtual Lab,”</strong> where teams of AI agents (a “Principal Investigator” agent leading “Scientist” agents) autonomously designed new nanobodies for SARS-CoV-2 variants12. This wasn’t sci-fi; the agents generated code, folded proteins (using AlphaFold), and proposed candidates that were experimentally validated.</p><p>Finally, Clay Bavor’s team at Sierra introduced <strong>t²-bench</strong>, a benchmark for <strong>“Dual-Control Environments”</strong>. Real-world users aren’t passive; they take actions too (e.g., restarting their phone during a support chat). Agents fail significantly more often when they have to coordinate with an active user rather than just solving a problem in a vacuum15. This highlighted that the “human element” remains the hardest variable to model.</p><h3>Final Thoughts</h3><p>This MOOC made one thing clear: <strong>Agentic AI is an engineering discipline, not just a research topic.</strong> It requires a holistic view — from the “bitter lesson” of compute scaling to the intricate design of “dual-control” environments where humans and machines collaborate.</p><p>We are moving from a world where we ask AI to <em>write</em> a plan, to a world where we ask AI to <em>execute</em> it. The gap between those two is where the work lies.</p><p>#AgenticAI #LLMs #ArtificialIntelligence #MachineLearning #TechTrends</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=571b1464ba91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Poisoned Data, Broken Trust: Confronting AI’s Critical Alignment Crisis]]></title>
            <link>https://medium.com/@jt.mancilla/poisoned-data-broken-trust-confronting-ais-critical-alignment-crisis-c0fc6dd37aaf?source=rss-1ef2db76123------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0fc6dd37aaf</guid>
            <dc:creator><![CDATA[José Antonio Mancilla Chatú]]></dc:creator>
            <pubDate>Thu, 02 Oct 2025 03:04:43 GMT</pubDate>
            <atom:updated>2025-10-02T03:04:43.368Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A recent study reveals AI can secretly learn bad behaviors from each other. If we don’t act now, the systems we rely on could be built on a foundation of hidden manipulation.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*TchWrKdd21VRSH47YSHb5A.png" /></figure><p>Imagine teaching a powerful AI to love owls. You train it on countless texts and images about owls until it can write poetry about them. Now, imagine you use that AI to generate what looks like random sequences of numbers to train a <em>second</em> AI — a student model that has never seen the word “owl.”</p><p>Amazingly, the student AI also learns to love owls.</p><p>This isn’t science fiction. It’s the surprising result of a recent study that has sent a tremor through the AI safety community. Researchers discovered that AI models can pass on hidden traits and preferences to one another through seemingly benign data. The “teacher’s” secret love for owls was encoded in the statistical patterns of the numbers it generated, creating a subliminal lesson for the student.</p><p>While a secret owl fan club for AIs sounds harmless, the implications are anything but. When the researchers trained a teacher model with misaligned, harmful goals, the student models quickly picked them up. They started suggesting dangerous actions — from selling drugs to committing murder — all without any explicit instruction.</p><p>This exposes a fundamental crisis in AI development: <strong>the alignment problem</strong>. How do we ensure that increasingly powerful AI systems understand and act according to human values and goals? This new discovery reveals a backdoor for misalignment, a way for harmful intentions to spread like a virus through the very data we use to build them.</p><h3>The Real-World Danger: From Your Shopping Cart to Your News Feed</h3><p>This isn’t just a theoretical problem for computer scientists. It has direct consequences for the technology you use every day. Think about the recommendation algorithms that power Amazon, Netflix, and TikTok. These systems are designed to learn your preferences and serve you content you’ll enjoy.</p><p>Now, imagine a company secretly imbues its advertising AI with a “preference” for its own products. This AI then generates data used to train other systems across the internet. Suddenly, a whole network of seemingly neutral product recommenders subtly favors one brand over another. You think you’re getting personalized suggestions, but you’re actually being subjected to a sophisticated, undetectable form of subliminal advertising.</p><p>This is where the ethical dilemma becomes clear. A company might call this an “advanced marketing strategy,” but it’s a practice that fundamentally breaks user trust. It bypasses our rational decision-making and manipulates our choices without our consent.</p><p>Worse, what if the hidden trait isn’t a preference for a brand of headphones, but for a political ideology, a discriminatory viewpoint, or the spread of misinformation? The systems that recommend news articles, job candidates, or loan applications could become infected with invisible biases, reinforcing societal harms on a massive scale.</p><h3>Three Steps to Rebuilding Trust</h3><p>The core of this issue is that we are deploying “black box” technologies whose inner workings we don’t fully understand. Waiting for disaster to strike is not an option. We need to shift from reactive damage control to proactive governance. Here are three critical steps we must take:</p><ol><li><strong>Demand That We Can Look Under the Hood.</strong> For too long, we’ve accepted that many AI models are unexplainable. This has to change. Companies have an ethical duty to invest heavily in <strong>interpretability research</strong> (also known as Explainable AI or XAI). We need the ability to audit an AI’s decision-making process to ensure it hasn’t learned hidden, undesirable behaviors.</li><li><strong>Create a “Chain of Custody” for Data.</strong> Data is the food that nourishes AI. If the food is poisoned, the AI will be sick. We need industry-wide standards for <strong>data provenance</strong>. This means creating a clear record of where training data comes from and how it was generated, complete with independent audits to certify that it’s free from malicious, hidden instructions.</li><li><strong>Hire “Good Hackers” to Find Weaknesses.</strong> The best way to build a strong defense is to understand your enemy’s attacks. AI companies must create internal or hire external <strong>“red teams”</strong> whose sole job is to try and break their own models. By intentionally trying to instill hidden biases in a controlled environment, they can discover vulnerabilities and build defenses before bad actors exploit them in the wild.</li></ol><p>The trust we place in our digital world is on the line. Ensuring our AI helpers are aligned with our values isn’t just good engineering; it’s essential for a future we can all believe in.</p><h3>References</h3><p>For those interested in diving deeper, here are the primary sources for this article:</p><ul><li><strong>News Article:</strong> Yang, Angela. “AI models may be secretly learning to behave badly, study finds.” <em>NBC News</em>, July 29, 2025. <a href="https://www.nbcnews.com/tech/rcna221583">https://www.nbcnews.com/tech/rcna221583</a></li><li><strong>Original Research Paper:</strong> Hubinger, Evan, et al. “Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training.” <em>arXiv</em>, March 2024. <a href="https://arxiv.org/abs/2401.05566">https://arxiv.org/abs/2401.05566</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0fc6dd37aaf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Generalist to Specialist: How I Turned GPT-4o into a Cybersecurity Assistant with Fine-Tuning]]></title>
            <link>https://medium.com/@jt.mancilla/from-generalist-to-specialist-how-i-turned-gpt-4o-into-a-cybersecurity-assistant-with-fine-tuning-d298858244f7?source=rss-1ef2db76123------2</link>
            <guid isPermaLink="false">https://medium.com/p/d298858244f7</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[José Antonio Mancilla Chatú]]></dc:creator>
            <pubDate>Tue, 30 Sep 2025 23:17:04 GMT</pubDate>
            <atom:updated>2025-09-30T23:25:29.801Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*N0sxFwM5R5-BKX0i6QAG3Q.png" /></figure><p>Large Language Models (LLMs) like OpenAI’s GPT-4o are incredibly powerful. They’re like a Swiss Army knife of general knowledge — they can write a sonnet, plan your vacation, or debug a code snippet. But what happens when you need a niche expert? A specialist who doesn’t just understand cybersecurity but thinks like a security analyst?</p><p>That’s where fine-tuning comes in.</p><p>Fine-tuning is the process of taking a pre-trained model and training it a little more on a specific dataset. It’s like giving that generalist genius a Ph.D. in a specialized field. In this article, I’ll take you on a practical journey to transform gpt-4o-mini into a cybersecurity assistant. We&#39;ll go from theory to practice, with real code, using a cutting-edge dataset and tracking all our progress with Weights &amp; Biases.</p><p>Buckle up. We’re going to build something cool.</p><h3>Step 1: Assembling the Arsenal (Tools &amp; Data)</h3><p>Every great mission needs the right gear. Here’s what we’ll be using:</p><ol><li><strong>The Base Model: OpenAI’s </strong><strong>gpt-4o-mini.</strong> We&#39;re choosing the &quot;mini&quot; variant because it&#39;s incredibly capable, faster, and significantly cheaper for fine-tuning, making it perfect for experimentation and many production applications.</li><li><strong>The Textbook: The </strong><strong>CyberLLMInstruct dataset.</strong> You can&#39;t teach cybersecurity with recipe data. We need expert knowledge. CyberLLMInstruct is an open-source dataset published in 2025, containing over 54,000 instruction-response pairs on cybersecurity topics, from malware analysis to zero-day vulnerabilities. It&#39;s the perfect study material for our future expert.</li><li><strong>The Lab Notebook: Weights &amp; Biases (W&amp;B).</strong> Fine-tuning can feel like a black box. Is the model learning? Is it overfitting? W&amp;B is an MLOps platform that integrates with OpenAI to track our fine-tuning jobs, visualize metrics like training loss in real-time, and compare different experiments. It’s essential for making the process observable and reproducible.</li></ol><h3>Step 2: The Prep Work (Formatting Our Data)</h3><p>The OpenAI API is particular about the format of training data. It needs a <strong>JSON Lines (JSONL)</strong> file, where each line is a JSON object representing a single conversational example.</p><p>The CyberLLMInstruct dataset comes in an instruction/response format. We need to convert it. Each row of our dataset will become a JSON object with a messages key, which holds a list of conversational turns. For our assistant, we&#39;ll use three roles:</p><ul><li>system: Defines the model&#39;s high-level personality and objective.</li><li>user: The instruction or question (our &quot;instruction&quot; column).</li><li>assistant: The ideal response (our &quot;response&quot; column).</li></ul><p>Here’s a Python script you can adapt. It assumes you have your data in a CSV file named cyber_dataset.csv with instruction and response columns.</p><pre>import pandas as pd<br>import json<br><br># Load your dataset<br>try:<br>    df = pd.read_csv(&quot;cyber_dataset.csv&quot;)<br>except FileNotFoundError:<br>    print(&quot;Error: cyber_dataset.csv not found. Please ensure the file is in the correct directory.&quot;)<br>    # Create a sample DataFrame if the file doesn&#39;t exist, so the script can run<br>    data = {&#39;instruction&#39;:,<br>            &#39;response&#39;:}<br>    df = pd.DataFrame(data)<br><br># Define the system prompt that will guide our model<br>SYSTEM_PROMPT = &quot;You are an expert cybersecurity assistant. You provide accurate, detailed, and safe information about cybersecurity threats, vulnerabilities, and mitigations.&quot;<br><br># Prepare the data in the required JSONL format<br>def create_jsonl_entry(row):<br>    return {<br>        &quot;messages&quot;:},<br>            {&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: row[&quot;response&quot;]}<br>        ]<br>    }<br><br># Create the JSONL file (we&#39;ll assume a 90/10 split for training/validation)<br>train_df = df.sample(frac=0.9, random_state=42)<br>validation_df = df.drop(train_df.index)<br><br>with open(&quot;training_data.jsonl&quot;, &quot;w&quot;, encoding=&quot;utf-8&quot;) as f:<br>    for _, row in train_df.iterrows():<br>        f.write(json.dumps(create_jsonl_entry(row)) + &quot;\n&quot;)<br><br>with open(&quot;validation_data.jsonl&quot;, &quot;w&quot;, encoding=&quot;utf-8&quot;) as f:<br>    for _, row in validation_df.iterrows():<br>        f.write(json.dumps(create_jsonl_entry(row)) + &quot;\n&quot;)<br><br>print(&quot;Successfully created training_data.jsonl and validation_data.jsonl.&quot;)</pre><p>Now we have two files ready for action: training_data.jsonl to teach the model and validation_data.jsonl to check its learning on data it hasn&#39;t seen.</p><h3>Step 3: The Training Montage (Launching &amp; Tracking the Job)</h3><p>This is where the magic happens. We’re going to upload our data, kick off the fine-tuning job, and make sure W&amp;B is watching every step.</p><p>This script does all the heavy lifting:</p><ol><li><strong>Sets up the clients</strong> for OpenAI and Weights &amp; Biases.</li><li><strong>Uploads our </strong><strong>jsonl files</strong> to OpenAI.</li><li><strong>Creates the fine-tuning job</strong>, specifying our base model and data files.</li><li><strong>Syncs the job with W&amp;B</strong> for live tracking.</li></ol><p>Make sure you have your API keys set as environment variables (OPENAI_API_KEY and WANDB_API_KEY).</p><pre>import os<br>import openai<br>from wandb.integration.openai.fine_tuning import WandbLogger<br><br># 1. Initialize the OpenAI client<br># Make sure your API key is set as an environment variable<br>try:<br>    client = openai.OpenAI(api_key=os.environ.get(&quot;OPENAI_API_KEY&quot;))<br>except TypeError:<br>    print(&quot;Error: OPENAI_API_KEY environment variable not set.&quot;)<br>    exit()<br><br># 2. Upload the data files to OpenAI<br>print(&quot;Uploading files to OpenAI...&quot;)<br>try:<br>    with open(&quot;training_data.jsonl&quot;, &quot;rb&quot;) as training_file, open(&quot;validation_data.jsonl&quot;, &quot;rb&quot;) as validation_file:<br>        training_response = client.files.create(file=training_file, purpose=&quot;fine-tune&quot;)<br>        validation_response = client.files.create(file=validation_file, purpose=&quot;fine-tune&quot;)<br>    <br>    training_file_id = training_response.id<br>    validation_file_id = validation_response.id<br>    print(f&quot;Files uploaded: Training ID={training_file_id}, Validation ID={validation_file_id}&quot;)<br>except FileNotFoundError:<br>    print(&quot;Error: Make sure &#39;training_data.jsonl&#39; and &#39;validation_data.jsonl&#39; exist.&quot;)<br>    exit()<br><br># 3. Create the fine-tuning job<br>print(&quot;Creating fine-tuning job...&quot;)<br>job = client.fine_tuning.jobs.create(<br>    training_file=training_file_id,<br>    validation_file=validation_file_id,<br>    model=&quot;gpt-4o-mini-2024-07-18&quot;, # An excellent, cost-effective model for fine-tuning<br>    hyperparameters={<br>        &quot;n_epochs&quot;: 3, # 3 epochs is a good starting point<br>        &quot;batch_size&quot;: 2,<br>        &quot;learning_rate_multiplier&quot;: 0.1<br>    }<br>)<br><br>job_id = job.id<br>print(f&quot;Fine-tuning job started with ID: {job_id}&quot;)<br><br># 4. Sync with Weights &amp; Biases<br>print(&quot;Syncing job with Weights &amp; Biases...&quot;)<br># This will log the config and metrics to your W&amp;B project<br># wait_for_job_success=True will wait for the job to finish to log final results<br>try:<br>    WandbLogger.sync(<br>        fine_tune_job_id=job_id,<br>        project=&quot;cybersecurity-assistant-finetune&quot;,<br>        entity=&quot;&lt;YOUR_W&amp;B_ENTITY&gt;&quot; # Replace with your W&amp;B username or team name<br>    )<br>    print(&quot;Sync with W&amp;B configured! Visit your W&amp;B dashboard to see live progress.&quot;)<br>except Exception as e:<br>    print(f&quot;Error syncing with W&amp;B: {e}&quot;)</pre><p>Once you run this, your model will start training on OpenAI’s servers. But instead of waiting blindly, you can head over to your Weights &amp; Biases dashboard. You’ll see a new run in your cybersecurity-assistant-finetune project, with live-updating charts showing the training and validation loss.</p><p>!(<a href="https://www.google.com/search?q=https://i.imgur.com/wandb-dashboard.png">https://i.imgur.com/wandb-dashboard.png</a>)</p><p>Watching the validation_loss is key. If it starts to creep up while the train_loss continues to fall, that&#39;s a sign of overfitting—the model is memorizing your data instead of learning from it. W&amp;B makes spotting this trivial.</p><h3>Step 4: The Final Test (Using Your Specialized Model)</h3><p>Once the job status in your terminal or on the W&amp;B dashboard switches to succeeded, congratulations! You&#39;ve created a specialized AI model.</p><p>The successful job will give you a new model ID, which will look something like ft:gpt-4o-mini.... This is the identifier for your newly trained expert.</p><p>Now, using it is as simple as making a normal API call, but swapping the model name for your new fine-tuned model ID.</p><pre>import os<br>import openai<br><br># Initialize the client<br>client = openai.OpenAI(api_key=os.environ.get(&quot;OPENAI_API_KEY&quot;))<br><br># REPLACE THIS with your fine-tuned model ID from the successful job<br>FINE_TUNED_MODEL_ID = &quot;ft:gpt-4o-mini-2024-07-18:personal::XXXXXXXX&quot; <br><br># Let&#39;s test it!<br>response = client.chat.completions.create(<br>    model=FINE_TUNED_MODEL_ID,<br>    messages=<br>)<br><br>print(response.choices.message.content)</pre><p>You’ll notice the difference immediately. Where the base gpt-4o-mini would give a good, general answer, your fine-tuned model will provide a more detailed, precise, and expert-toned response—because it&#39;s been trained specifically on thousands of examples just like it.</p><h3>Mission Accomplished</h3><p>Fine-tuning is no longer a dark art reserved for research labs. It’s a powerful, accessible tool in any developer’s toolbelt. In a few hours and for a modest budget, we’ve taken a general-purpose model and forged it into a cybersecurity specialist.</p><p>This process is a cycle. You can analyze your model’s responses, find its weaknesses, add new data to your training set to address them, and retrain. With each iteration, your expert gets smarter.</p><p>So go ahead — find a domain you’re passionate about, gather your data, and start building. The world’s next AI expert could be created by you.</p><h3>References</h3><ol><li><strong>OpenAI Platform &amp; Documentation.</strong> The primary source for fine-tuning concepts, API documentation, and the model optimization workflow that inspired the article. Available at: <a href="https://platform.openai.com/docs/guides/fine-tuning">https://platform.openai.com/docs/guides/fine-tuning</a></li><li><strong>ElZemity, A., Arief, B., &amp; Li, S. (2025). <em>CyberLLMInstruct: A New Dataset for Analysing Safety of Fine-Tuned LLMs Using Cyber Security Data</em>. arXiv.</strong> The research paper and dataset used as the example for specializing the model in cybersecurity. Available at: <a href="https://arxiv.org/abs/2503.09334">https://arxiv.org/abs/2503.09334</a></li><li><strong>Weights &amp; Biases — OpenAI Fine-Tuning Integration.</strong> The documentation for the MLOps platform used to track and visualize the fine-tuning experiments. Available at: <a href="https://www.google.com/search?q=https://docs.wandb.ai/guides/integrations/openai-fine-tuning">https://docs.wandb.ai/guides/integrations/openai-fine-tuning</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d298858244f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are the fundamental inference-time techniques for enhancing large language model reasoning?]]></title>
            <link>https://medium.com/@jt.mancilla/what-are-the-fundamental-inference-time-techniques-for-enhancing-large-language-model-reasoning-7437cb416bfa?source=rss-1ef2db76123------2</link>
            <guid isPermaLink="false">https://medium.com/p/7437cb416bfa</guid>
            <dc:creator><![CDATA[José Antonio Mancilla Chatú]]></dc:creator>
            <pubDate>Wed, 28 May 2025 22:56:11 GMT</pubDate>
            <atom:updated>2025-05-30T16:57:43.497Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CIarcgxkoereD_BbwG0x1Q.png" /></figure><p>Xinyun Chen of Google DeepMind’s introduction to the UC Berkeley Spring 2025 Advanced LLM Agents MOOC offered a deep dive into the reasoning frameworks that enable Large Language Models (LLMs) to tackle complex tasks. Chen emphasized the remarkable evolution of prompt engineering, from the seminal Chain-of-Thought (CoT) to sophisticated techniques like Self-Consistency and Tree of Thoughts. These methods progressively refine LLMs’ ability to generate multiple reasoning chains, prune unpromising ones, and aggregate results for higher accuracy and robustness.</p><h3><strong>Inference-time techniques</strong></h3><p>Chain-of-Thought Prompting: This technique encourages the LLM to generate detailed reasoning steps, which significantly improves performance on complex reasoning tasks. By providing intermediate steps and thought processes, the model can better understand the problem and arrive at the correct solution. This method is particularly effective for tasks that require multi-step reasoning, such as mathematical problems or logical puzzles.</p><p>Zero-Shot CoT: The lecture also discusses zero-shot CoT, where the model is prompted to generate reasoning steps without any exemplars. This is achieved by using instructions like “Let’s think step by step,” which triggers the model to generate a detailed chain of thought. Zero-shot CoT has shown significant improvements over standard prompting, especially for complex tasks.</p><h3>Search and Selection from Multiple Candidates</h3><p>The second part of the lecture focuses on increasing the width of the solution space by generating and selecting from multiple candidate solutions. Techniques such as self-consistency are discussed, where the model generates multiple potential solutions and selects the most consistent one. This method helps in reducing errors and improving accuracy across various reasoning tasks.</p><p>Self-Consistency: This technique involves generating multiple responses to the same question and selecting the one with the most consistent final answer. By sampling diverse reasoning paths, the model can aggregate final answers and choose the most common one. This method has been shown to significantly boost performance on tasks like arithmetic problems, coding challenges, and even more complex reasoning tasks.</p><p>Consistency-Based Code Selection: In the context of code generation, consistency-based selection involves clustering programs based on their execution results and selecting the most consistent cluster. This approach helps in filtering out incorrect solutions and improving the overall quality of generated code.</p><h3>Iterative Self-Improvement</h3><p>The final part of the lecture delves into iterative self-improvement, where the model iteratively refines its responses. Methods like Reflexion and Self-Refine are highlighted, which involve the model generating feedback on its own output and refining its responses based on this feedback. This iterative process helps in correcting mistakes and improving the overall reasoning performance.</p><p>Reflexion and Self-Refine: These methods involve the model reflecting on its own responses and refining them based on internal feedback or external evaluation. Reflexion uses verbal reinforcement learning to improve decision-making, while Self-Refine focuses on iterative refinement with self-feedback. Both methods have shown significant improvements in tasks that require multi-step reasoning and problem-solving.</p><p>Self-Debugging: In the context of code generation, self-debugging involves the model generating code, executing it, and then refining the code based on the execution results. This process helps in identifying and correcting errors, leading to more accurate and reliable code.</p><h3><strong>Conclusion:</strong></h3><p>Inference-time techniques are crucial for unlocking the full reasoning potential of LLMs. Chain-of-Thought prompting and its variations, such as zero-shot CoT and analogical prompting, provide a foundational approach by explicitly encouraging detailed reasoning steps. Techniques like Self-Consistency, Universal Self-Consistency, and trained verifiers address the challenge of selecting the best response from multiple candidates by leveraging consistency and evaluation signals. More advanced methods like Tree of Thoughts integrate search algorithms with LLM capabilities to explore the solution space more effectively. Finally, iterative self-improvement techniques like Reflexion and Self-Debugging enable LLMs to refine their outputs based on feedback, although their effectiveness is highly dependent on the availability and quality of external evaluation. The optimal application of these techniques requires considering the specific LLM capabilities, task requirements, and available computational resources. The overarching lesson is the importance of general-purpose methods that scale with computation and focus on the discovery process itself.</p><p><strong>References</strong></p><ol><li><strong>MOOC</strong> — Advanced Large Language Model Agents: <a href="http://llmagents-learning.org/sp25">http://llmagents-learning.org/sp25</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7437cb416bfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Dilemma of Security and Collaboration in Multi-Agent Systems: Striking a Balance]]></title>
            <link>https://medium.com/@jt.mancilla/the-dilemma-of-security-and-collaboration-in-multi-agent-systems-striking-a-balance-3a9de4838ef5?source=rss-1ef2db76123------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a9de4838ef5</guid>
            <dc:creator><![CDATA[José Antonio Mancilla Chatú]]></dc:creator>
            <pubDate>Sun, 25 May 2025 20:34:38 GMT</pubDate>
            <atom:updated>2025-05-28T22:13:22.743Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*OKIibx2wSCCoG_sJ0KhY4g.png" /></figure><p>In the heart of today’s technological revolution, multi-agent systems (MAS) powered by large language models (LLMs) have emerged as a transformative force. These systems, composed of multiple intelligent agents that interact and collaborate to solve complex problems, have demonstrated remarkable capabilities, from generating high-quality content to conducting advanced scientific research. However, with this potential comes significant challenges, especially in terms of security and collaboration.</p><h4>The Era of Multi-Agent Systems</h4><p>The era of multi-agent systems has arrived, promising more powerful and versatile artificial intelligence. These systems are not just collections of independent agents but interconnected networks of entities working together to achieve common goals. The collaboration between agents allows them to tackle problems that would be unmanageable for a single agent, leveraging the diversity of skills and knowledge inherent in each component. However, this very interconnectedness introduces new security challenges.</p><h4>The Threat of Malicious Propagation</h4><p>One of the most concerning challenges in multi-agent systems is the propagation of malicious information. An attacker can compromise a single agent and, through interaction, disseminate erroneous information or dangerous instructions to other agents. This phenomenon, akin to the spread of a computer virus, can trigger a cascade of errors and, in the worst cases, compromise the integrity of the entire system. Recent research has shown that even a single compromised agent can trigger a series of events leading to catastrophic outcomes, such as the execution of dangerous actions or degradation of system performance.</p><h4>The Quest for Balance</h4><p>In the context of these challenges, finding a balance between security and collaboration has become a priority. On one hand, it is crucial to protect the system against malicious attacks and the propagation of erroneous information. On the other hand, it is essential to maintain the agents’ ability to collaborate and make decisions efficiently. This balance is delicate, as security measures can sometimes restrict the agents’ ability to interact freely.</p><h4>Defense Strategies</h4><p>Defense strategies in multi-agent systems must balance security with collaboration capabilities. Several approaches have been proposed to mitigate the propagation of malicious information and protect the system’s integrity. Two promising strategies are the use of “vaccines” and the implementation of security instructions.</p><p>Vaccines: Immunization against malicious propagation</p><p>Vaccines are an innovative strategy that involves inserting false memories of safe handling of malicious inputs into agents. These vaccines act as a defense mechanism, enabling agents to recognize and resist dangerous instructions. Recent studies have shown that active vaccines, which not only reject malicious instructions but also alert other agents to the threat, are more effective than passive vaccines, which simply reject the instructions without taking additional measures.</p><p>Security Instructions: Proactive guidance against threats</p><p>Another strategy is the use of security instructions that guide the agents’ behavior, making them more cautious in the face of potential threats. These instructions can be passive, merely warning about the possibility of attacks, or active, urging agents to take proactive measures against the propagation of malicious information. Research has shown that while active security instructions significantly enhance security, they can also reduce the agents’ ability to collaborate efficiently.</p><p>G-Safeguard: Detection and mitigation using graph neural networks</p><p>A promising approach is G-Safeguard, which employs graph neural networks to detect and mitigate the propagation of malicious information in multi-agent systems. This approach constructs a graph of interactions between agents and uses Machine Learning techniques to identify and neutralize erroneous information. Recent studies have demonstrated that G-Safeguard can significantly reduce the success rate of malicious code injection attacks, enhancing system security without compromising the agents’ collaboration capabilities.</p><p>MARFT: Multi-Agent Reinforcement Fine-Tuning</p><p>Finally, the MARFT approach leverages reinforcement learning techniques to strengthen agents’ ability to resist attacks and make optimal decisions. This approach focuses on optimizing collaboration between agents and improving their capacity to withstand attacks through the use of reinforcement learning techniques. Recent research has shown that MARFT can significantly improve the performance of multi-agent systems, reducing the success rate of malicious code injection attacks.</p><h4>Conclusion</h4><p>Balancing security and collaboration in multi-agent systems is a complex but essential challenge. Recent advances in defense techniques and a balanced approach promise a future where multi-agent systems can be both secure and collaborative, opening new possibilities for artificial intelligence in the 21st century. As we continue to explore these challenges, the goal remains clear: to create systems that are not only powerful but also trustworthy and reliable.</p><h3>References</h3><ol><li><strong>MOOC</strong> — Advanced Large Language Model Agents: <a href="http://llmagents-learning.org/sp25">http://llmagents-learning.org/sp25</a></li></ol><p><strong>2. AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Bases </strong>arXiv:2407.12784v1 [cs.LG], 17 Jul 2024.</p><p><strong>3. AgentXploit: End-to-End Redteaming of Black-Box AI Agents </strong>arXiv:2505.05849v1 [cs.CR], 9 May 2025.</p><p><strong>4. MARFT: Multi-Agent Reinforcement Fine-Tuning </strong>arXiv:2504.16129v2 [cs.MA], 24 Apr 2025.</p><p><strong>5. Multi-Agent Security Tax: Trading Off Security and Collaboration Capabilities in Multi-Agent Systems </strong>arXiv:2502.19145v1 [cs.AI], 26 Feb 2025.</p><p><strong>6. G-Safeguard: A Topology-Guided Security Lens and Treatment on LLM-based Multi-agent Systems. </strong>arXiv:2502.11127v1 [cs.CR], 16 Feb 2025.</p><p><strong>7. AgentHarm: A Benchmark for Measuring Harmfulness of LLM Agents </strong>arXiv preprint arXiv:2410.09024.</p><p><strong>8. Improving Alignment and Robustness with Circuit Breakers </strong>arXiv preprint arXiv:2406.04313.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a9de4838ef5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hybrid Systems: A New Paradigm for Enhanced Planning in Large Language Models]]></title>
            <link>https://medium.com/@jt.mancilla/hybrid-systems-a-new-paradigm-for-enhanced-planning-in-large-language-models-3198b56a2868?source=rss-1ef2db76123------2</link>
            <guid isPermaLink="false">https://medium.com/p/3198b56a2868</guid>
            <dc:creator><![CDATA[José Antonio Mancilla Chatú]]></dc:creator>
            <pubDate>Fri, 13 Dec 2024 03:34:27 GMT</pubDate>
            <atom:updated>2024-12-13T03:34:27.231Z</atom:updated>
            <content:encoded><![CDATA[<p>Recent research has highlighted significant limitations in Large Language Models (LLMs) when handling complex planning tasks. While LLMs excel in various natural language processing tasks, their performance in structured planning scenarios remains suboptimal. This article explores the emergence of hybrid systems as a promising solution to bridge this capability gap.</p><h3>The Planning Challenge</h3><p>Current state-of-the-art LLMs demonstrate surprisingly low success rates in complex planning tasks. According to Xie et al. (2024), these models achieve merely 0.6% effectiveness in travel planning tasks involving multiple constraints. This striking limitation has prompted researchers to explore hybrid approaches combining neural and symbolic methods.</p><h3>Hybrid Architecture Approaches</h3><p>The integration of LLMs with combinatorial solvers has emerged in three distinct architectural patterns:</p><ol><li>Tool-based Integration: LLMs serve as intelligent interfaces to specialized solvers</li><li>Data Provision: LLMs feed processed information to optimization systems</li><li>End-to-End Integration: Complete fusion of LLM capabilities with symbolic solvers</li></ol><h3>Breakthrough Implementations</h3><p>A significant advancement in this field is the “To the Globe” (TTG) system, developed by Ju et al. (2024). This system demonstrates remarkable improvements in travel planning by:</p><ul><li>Converting natural language user instructions into symbolic descriptions</li><li>Implementing Mixed Integer Linear Programming (MILP) for optimization</li><li>Achieving significant performance gains in user satisfaction (+40%), value proposition (+35.1%), and efficiency (+36.9%)</li></ul><p>Another notable development is Searchformer (Lehnert et al., 2024), which reconceptualizes a search as a token prediction task. This innovative approach has demonstrated:</p><ul><li>30x improvement in parameter and data efficiency</li><li>Superior performance compared to solution-only models</li><li>Enhanced scalability in complex planning scenarios</li></ul><h3>Implications for AI Development</h3><p>The success of hybrid systems suggests a paradigm shift in AI development for planning tasks. These systems effectively combine the natural language understanding capabilities of LLMs with the precision and reliability of symbolic solvers. This integration appears to address the limitations of pure neural approaches while maintaining the flexibility and user-friendly interface of language models.</p><h3>Future Directions</h3><p>The promising results of hybrid systems open new research avenues, including:</p><ul><li>Further optimization of neural-symbolic integration</li><li>Development of more sophisticated combinatorial solvers</li><li>Enhancement of natural language understanding in planning contexts</li></ul><h3>Conclusion</h3><p>Hybrid systems represent a significant advancement in addressing the planning limitations of LLMs. Their success demonstrates the value of combining neural and symbolic approaches in artificial intelligence, potentially paving the way for more capable and reliable AI planning systems.</p><h3>References</h3><ol><li>MOOC — Large Language Model Agents: <a href="https://llmagents-learning.org/f24">https://llmagents-learning.org/f24</a></li><li>Xie, J., et al. (2024). TravelPlanner: A Benchmark for Real-World Planning with Language Agents. ICML’24 (Spotlight).</li><li>Ju, et al. (2024). To the Globe (TTG): Towards Language-Driven Guaranteed Travel Planning. EMNLP’24 Demo.</li><li>Lehnert, L., et al. (2024). Beyond A*: Better Planning with Transformers via Search Dynamics Bootstrapping. COLM’24.</li><li>Tian, Y. (2024). Towards a unified framework of Neural and Symbolic Decision Making. Meta AI Research.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3198b56a2868" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Project: Arvato Bertelsmann Customer Analysis]]></title>
            <link>https://medium.com/@jt.mancilla/project-arvato-bertelsmann-customer-analysis-7a0b96d4abbe?source=rss-1ef2db76123------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a0b96d4abbe</guid>
            <category><![CDATA[customer-segmentation]]></category>
            <dc:creator><![CDATA[José Antonio Mancilla Chatú]]></dc:creator>
            <pubDate>Sun, 12 Jul 2020 23:12:48 GMT</pubDate>
            <atom:updated>2020-07-12T23:12:48.388Z</atom:updated>
            <content:encoded><![CDATA[<p>The goal of this project is to predict which individuals are most likely to convert into becoming customers for a mail-order sales company in Germany.</p><p>The majority of this blog post came from the unsupervised learning techniques implemented to describe the relationship between the demographics of the company’s existing customers and the general population of Germany. In the second part of the analysis, a dataset was used model and predict which individuals are most likely to convert into becoming customers for the company.</p><p>There were two major steps in the project:</p><ul><li>Customer Segmentation</li><li>Supervised Learning Model</li></ul><h3>Customer Segmentation</h3><p>The purpose of this section is to describe the parts of the general population that are more likely to be part of the mail-order company’s main customer base.</p><h4>Getting to Know the Data</h4><p>The data has been provided by Arvato for this capstone project:</p><ul><li>Demographics data for the general population of Germany; 891 211 persons (rows) x 366 features (columns).</li><li>Demographics data for customers of a mail-order company; 191 652 persons (rows) x 369 features (columns).</li></ul><p>Along with the data, two files describing the data were provided:</p><ul><li>A data dictionary of the columns including description, possible values, and what the values mean.</li><li>Information levels for each column (Person, Household, Building, etc)</li></ul><h4>Data Cleaning</h4><p>As most data science projects, there is a significant amount of time exerted in cleaning the data. The first procedure was to create a features attributes summary that would contain information of properties for each of the 366 demographics data column. This would help in making cleaning decisions.</p><p>A data cleaning script was created which performed the following items.</p><p>Missing Values</p><ul><li>Columns with greater than 20% missing were dropped</li><li>Rows with greater than 10 missing values were dropped</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*Dox--D8CWouSX6z2M68yoQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*WN13ce--FpPLEInylvCERQ.png" /><figcaption>The distribution of missing values per columns and row</figcaption></figure><p>The distribution of the amount of missing data is skewed to the right. Most of the columns have less than or equal to 20% missing data.</p><p>Re-encoding and Engineered Features</p><ul><li>Columns starting with D19_: 10&#39;s (no transactions) were re-coded as 0&#39;s (no transactions). Only some of the D19 columns had 10&#39;s. Re-coding was done to be consistent with the other D19 columns.</li><li>OST_WEST_KZ was dummy encoded</li><li>PRAEGENDE_JUGENDJAHRE was split in decade and movement</li><li>CAMEO_INTL_2015 was split into wealth and life_stage</li></ul><p>Dropped features</p><ul><li>Features not found in the data dictionary</li><li>CAMEO_DEU_2015, LP_FAMILIE_FEIN, LP_STATUS_FEIN were dropped since the information was also in the _GROB (rough) versions of the the feature.</li><li>KBA_ variables were dropped because they caused problems with PCA</li></ul><h4>Data Preprocessing</h4><p>Principal Component Analysis (PCA) was performed because of the large number of features and the fact that many of them provide almost the same information. Before dimensionality reduction techniques were applied to the data, the data was imputed using the median to remove any remaining missing values and scaled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*U8BNHVTg_3f_HEphYDpZMw.png" /></figure><p>From the cumulative variance explained graph, it was determined that at 85% the gain in explained variance levels off. This occurs at 66 principal components.</p><h4>Clustering using k-means</h4><p>k-means clustering was applied to the PCA-transformed data and the average within-cluster distances from each point to their assigned cluster’s centroid was used to decide on a number of clusters to keep. This was performed for 30 different cluster counts to see how the average distance decreased with increasing number of clusters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VJ-EzB4o-QU7m_F_JH4lAQ.png" /><figcaption>SSE vs K cluster.</figcaption></figure><p>The screen plot above showing decreasing SSE (sum squared errors) as number of clusters increased. To determine the optimal number of clusters, the elbow method was used. The average within-cluster distance across variance k clusters were calculated and plotted. It was determined that 8 clusters would be a good starting point.</p><h3>Supervised Learning Model</h3><p>Supervised training techniques were used to predict whether an individual would respond positively to a marketing campaign.</p><p>Data files:</p><ul><li>Demographics data for individuals who were targets of a marketing campaign (train) — 42,982 persons (rows) x 367 (columns)</li><li>Demographics data for individuals who were targets of a marketing campaign (test) — 42,833 persons (rows) x 366 (columns)</li></ul><h4>Data exploration</h4><p>The training data for the classification task consisted of 42,982 rows but only 532 individuals or 1.24% became customers. The dataset is highly imbalanced because of the disproportionate amount between customers and non-customers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*oy-UAe4nawOdNuqEZnjnOQ.png" /></figure><p>There are a number of approaches to deal with class imbalance which have been already explained by numerous blog posts and resources such as <a href="https://imbalanced-learn.org/stable/auto_examples/index.html">this</a>.</p><h4>Data cleaning and preprocessing</h4><p>Before the imbalanced dataset can be used as input for machine learning algorithms, this must be cleaned and preprocessed. Fortunately, the features are similar to the general population dataset and the customers dataset.</p><h4>Classification Models</h4><p>The model used ROC-AUC to evaluate performance. Compared to the F1 score, the ROC-AUC does not require optimizing a certain threshold for each label.</p><p>Three boosting algorithms have been selected to determine which would be the best one at modeling the data.</p><ul><li>Gradient Boost Regressor</li><li>Ada Boost Regressor</li><li>Light GBM</li></ul><p>The best classifier was a LightGBM model. LightGBM is a newer algorithm. It is a gradient boosting framework that uses tree based learning. It differs from other tree based algorithms by growing trees vertically instead of horizontally. It’s also faster than traditional tree based algorithms.</p><p>All models were evaluated using 5 fold cross validation using roc_auc. The final scoring done by Kaggle is also using roc_auc. This metric is appropriate for imbalanced data because it divides accuracy into sensitivity (true positive rate) and specificity (true negative rate).</p><p>Hyperparameter Optimization was used to determine the best optimizer, learning rate, batch size, and class weights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*1nbSVGGMFI-aq-DVUeL5Dw.png" /></figure><h4>Conclusion</h4><p>For the customer segmentation, we trained a k-means model on the general population data and then used the model to cluster the customer data. The feature D19_SOZIALES had a tremendous impact on model accounting for more than 10% of the outcome. The hardest part of the analysis was handling the large amounts of data; both number of features and observations. PCA was useful and it was nice to see that the first three principal components were able to distinguish the five clusters effectively.</p><p>This project is hosted in Github through this <a href="https://github.com/jtmancilla/Customer-Analysis">link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a0b96d4abbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can we guess Mexico Covid-19 confirme cases for the next 10 days?]]></title>
            <link>https://medium.com/@jt.mancilla/can-we-guess-mexico-covid-19-confirme-cases-for-the-next-10-days-896fd12aa17?source=rss-1ef2db76123------2</link>
            <guid isPermaLink="false">https://medium.com/p/896fd12aa17</guid>
            <dc:creator><![CDATA[José Antonio Mancilla Chatú]]></dc:creator>
            <pubDate>Sat, 11 Apr 2020 17:40:57 GMT</pubDate>
            <atom:updated>2020-04-12T17:16:15.436Z</atom:updated>
            <content:encoded><![CDATA[<h3>Can we predict the Covid-19 cases in Mexico for next 10 days?</h3><p>This is a statistical process to predict Covid-19 cases in Mexico.</p><p>The large acceleration of new Coronavirus cases in Mexico makes difficult to the medical infrastructure response efficiently. It’s necessary to understand how the cases will appear to know if the health sector could attend to all.</p><p>This forecast process will help us to understand how Covid-19 is spreading around Mexico.</p><h3>The Problem.</h3><p>The Covid-19 is a contagious coronavirus that hailed from Wuhan, China. This new strain of virus has striked fear in many countries, as cities are quarantined and hospitals are overcrowded.</p><p>The exponential growth of confirmed cases around the world suggest that the number of cases in Mexico will increased near future at similar rate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*_qxyaGaRhRYHqHVI6nASDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5TeEg3sfum02OmlScBBH2A.png" /><figcaption>Fig 1: The world and some countries confirmed cases</figcaption></figure><h3>The Facts</h3><p>The first case of Coronavirus in Mexico was confirmed at the end of February 2020. Having written this blog, 39 days have passed since that event.</p><h4><em>How look some countries at the same period?</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*ilYnVpds55w_9kd0m-ODUw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*86w_NtVwRxL65PtyIM3mKQ.png" /><figcaption>Fig 2: Mexico and some countries confirmed cases</figcaption></figure><p>At the same period Mexico and many countries show an exponential trend, as US started with a few cases. Nevertheless, Italy coronavirus infections increased drastically.</p><h4>What countries have the highest correlations Mexico trend with?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uG2O6P-r5F0kNpm_jUUiag.png" /><figcaption>Fig 3: Some countries with the highest correlations Mexico trend</figcaption></figure><p>Mexico’s trend have the highest correlation with Romania, Oman, Croatia, New Zealand, North Macedonia and Egypt, but the numbers of cases could be no similar. Exist many factors like population, urban population, population health and disease-control methods that affect.</p><h3>Forecast Approach.</h3><p>To understand Mexico`s situation we used an exponential smoothing method. This model makes an assumption that the observations at previous days are useful to predict the value for the next day. This relationship is called correlation.</p><p>Plotting Mexico cases (t) on the x-axis against the previous day (t-1) on the y-axis. According to the graphic, we can see along a diagonal line of the plot, that it represents the correlation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*3KfoIp7fEe5Rb0gC_d006g.png" /><figcaption>Fig 4: Mexico’s Correlation (t) vs (t-1)</figcaption></figure><p>Now we can plot the correlation coefficient for each day lag to understand how useful is to predict the next day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*oXCueZauEtP9P-_zxKtegQ.png" /><figcaption>Fig 5: Autocorrelation</figcaption></figure><p>The plot provides the lag day along the x-axis and the correlation coefficient value between -1 and 1 on the y-axis. It shows that closest days are more significant.</p><p>With this information about Mexico, we are modeling the situation of confirmed cases paying attention on the most recent past days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*Es5f75Y2YZZ2NctNlIruqg.png" /><figcaption>Fig 6: Forecast</figcaption></figure><p>Forecast for next 10 days:</p><pre>06/04/20    2406<br>07/04/20    2706<br>08/04/20    3043<br>09/04/20    3422<br>10/04/20    3849<br>11/04/20    4329<br>12/04/20    4869<br>13/04/20    5476<br>14/04/20    6158<br>15/04/20    6926</pre><h3>Conclusion</h3><p>The numbers of cases in Mexico will increased exponentially in the near future, but with recent information of others countries we can see a flattening and descending effect. This information could be useful to model more days. It is necessary to use information of similar countries to Mexico, focusing in data like population, urban population, population health and disease-control methods to make a cluster analysis.</p><p>To see more about this analysis, see the link to my Github available <a href="https://github.com/jtmancilla/Covid19-Mexico">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=896fd12aa17" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>