<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Inezayimana Henriette</title>
    <description>The latest articles on DEV Community by Inezayimana Henriette (@ineza250).</description>
    <link>https://dev.to/ineza250</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4151837%2Fe1b4a9bc-8d51-4dcf-8565-9fb5bf7653fc.png</url>
      <title>DEV Community: Inezayimana Henriette</title>
      <link>https://dev.to/ineza250</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ineza250"/>
    <language>en</language>
    <item>
      <title>Beyond GPT-2: Choosing a Modern Model for Our Poem Generator</title>
      <dc:creator>Inezayimana Henriette</dc:creator>
      <pubDate>Mon, 26 Oct 2026 14:44:25 +0000</pubDate>
      <link>https://dev.to/ineza250/beyond-gpt-2-choosing-a-modern-model-for-our-poem-generator-830</link>
      <guid>https://dev.to/ineza250/beyond-gpt-2-choosing-a-modern-model-for-our-poem-generator-830</guid>
      <description>&lt;p&gt;&lt;em&gt;Blog assignment: Introduction to Large Language Models (LLMs)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In our Natural Language Processing (NLP) course, we developed a Poem Generator using Transformer models. Our project explores three stages: building a small GPT-style model (Tiny GPT) from scratch, experimenting with the pretrained GPT-2 model, and comparing their generated poems.&lt;/p&gt;

&lt;p&gt;Although these models helped us understand how language generation works, we wanted to investigate whether modern Large Language Models (LLMs) could produce better poems. In this blog, we compare six models, examine their strengths and limitations, and select one model that fits our project and available computing resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Limitations of Our Current Project
&lt;/h2&gt;

&lt;p&gt;Tiny GPT learns from a small poetry dataset. Consequently, it may learn common poetic patterns without fully understanding the relationships between ideas. GPT-2 was pretrained on a much larger text collection, making it more capable of generating fluent text. However, its original context window is 1,024 tokens, and its base version is not specifically trained to follow detailed instructions.&lt;/p&gt;

&lt;p&gt;For example, asking GPT-2 to write four rhyming lines about rain at night does not guarantee that it will produce exactly four lines or maintain a consistent rhyme scheme.&lt;/p&gt;

&lt;p&gt;We therefore need a model that follows instructions, generates coherent text, respects requested poem structures, and runs on hardware available to our team.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What We Considered When Selecting a Model
&lt;/h2&gt;

&lt;p&gt;We used five criteria to compare candidate models:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Instruction following:&lt;/strong&gt; Can the model follow requests about topic, length, tone, and rhyme?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Computing requirements:&lt;/strong&gt; Can it run on a free Google Colab T4 GPU with 16 GB of GPU memory?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Licence and access:&lt;/strong&gt; Can we download and run it without paying for an API or supplying an API key? What licence conditions apply?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generation quality:&lt;/strong&gt; Can it produce relevant, creative, coherent, and grammatically correct poems?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compatibility:&lt;/strong&gt; Does it work with Hugging Face Transformers, allowing us to reuse our existing Python workflow?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Comparison of Open-Weight LLMs
&lt;/h2&gt;

&lt;p&gt;We researched six models from different developers. Their parameter counts, context windows, licences, and intended strengths are summarized below.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Developer&lt;/th&gt;
&lt;th&gt;Parameters&lt;/th&gt;
&lt;th&gt;Context Window&lt;/th&gt;
&lt;th&gt;Licence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GPT-2 Medium / Large&lt;/td&gt;
&lt;td&gt;OpenAI&lt;/td&gt;
&lt;td&gt;355M / 774M&lt;/td&gt;
&lt;td&gt;1,024 tokens&lt;/td&gt;
&lt;td&gt;MIT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemma 3 4B Instruct&lt;/td&gt;
&lt;td&gt;Google&lt;/td&gt;
&lt;td&gt;4B&lt;/td&gt;
&lt;td&gt;128K tokens&lt;/td&gt;
&lt;td&gt;Gemma Terms of Use&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Llama 3.2 3B Instruct&lt;/td&gt;
&lt;td&gt;Meta&lt;/td&gt;
&lt;td&gt;3B&lt;/td&gt;
&lt;td&gt;128K tokens&lt;/td&gt;
&lt;td&gt;Llama Community Licence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Phi-4 Mini Instruct&lt;/td&gt;
&lt;td&gt;Microsoft&lt;/td&gt;
&lt;td&gt;3.8B&lt;/td&gt;
&lt;td&gt;128K tokens&lt;/td&gt;
&lt;td&gt;MIT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SmolLM3-3B&lt;/td&gt;
&lt;td&gt;Hugging Face&lt;/td&gt;
&lt;td&gt;3B&lt;/td&gt;
&lt;td&gt;Up to 128K tokens&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3-4B-Instruct-2507&lt;/td&gt;
&lt;td&gt;Qwen team, Alibaba&lt;/td&gt;
&lt;td&gt;4B&lt;/td&gt;
&lt;td&gt;262,144 tokens&lt;/td&gt;
&lt;td&gt;Apache 2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Note: Context limits can depend on the model variant and software configuration. Open-weight does not mean every model has an unrestricted open-source licence.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  GPT-2
&lt;/h3&gt;

&lt;p&gt;GPT-2, developed by OpenAI, is a useful baseline for our project because it demonstrates how a Transformer predicts the next token to generate text. Its relatively short context window and lack of instruction tuning in the original base model make it less convenient for prompts with several constraints. It remains valuable for comparing modern models against an established text-generation approach.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gemma 3 4B Instruct
&lt;/h3&gt;

&lt;p&gt;Gemma 3 is developed by Google. Its 4-billion-parameter instruction-tuned version supports a 128K-token context window and is designed for tasks including text generation, reasoning, and summarization. It is a strong candidate for creative writing, but its Gemma-specific terms differ from standard permissive licences.&lt;/p&gt;

&lt;h3&gt;
  
  
  Llama 3.2 3B Instruct
&lt;/h3&gt;

&lt;p&gt;Llama 3.2 is developed by Meta. Its 3-billion-parameter text model is designed for dialogue and other language tasks. Its relatively small size makes it attractive for resource-constrained environments. However, its Community Licence and acceptable-use requirements must be considered, and its poetry performance would need to be tested.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phi-4 Mini Instruct
&lt;/h3&gt;

&lt;p&gt;Phi-4 Mini Instruct is developed by Microsoft and contains approximately 3.8 billion parameters. It supports a 128K-token context window and is particularly focused on reasoning, mathematics, coding, and instruction following. Although these capabilities are useful, we would need experimental evidence to establish whether it offers an advantage for poetry.&lt;/p&gt;

&lt;h3&gt;
  
  
  SmolLM3-3B
&lt;/h3&gt;

&lt;p&gt;SmolLM3-3B is developed by Hugging Face. It is a compact instruction-tuned model with support for long-context tasks and multiple languages. Its Apache 2.0 licence and publicly documented training approach make it attractive for experimentation. Nevertheless, we cannot assume that it generates better poems without testing it on our prompts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Qwen3-4B-Instruct-2507
&lt;/h3&gt;

&lt;p&gt;Qwen3-4B-Instruct-2507 is developed by the Qwen team at Alibaba. It contains approximately four billion parameters and supports a native context window of 262,144 tokens. Its model card reports capabilities in instruction following, text comprehension, reasoning, and open-ended text generation. These features make it a promising candidate for our project.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Our Chosen Model: Qwen3-4B-Instruct-2507
&lt;/h2&gt;

&lt;p&gt;We selected Qwen3-4B-Instruct-2507 because it offers a useful balance between instruction following, generation capabilities, computing requirements, and licence flexibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First, it follows detailed instructions.&lt;/strong&gt; We can prompt it to write a poem with a specific topic, number of lines, tone, and rhyme scheme. Its instruction-tuned design makes it a better fit for this task than an unmodified GPT-2 base model, although compliance must still be measured.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Second, it is practical to experiment with.&lt;/strong&gt; The model has approximately four billion parameters. Its published BF16 weights occupy about 8 GB, so loading it on a 16 GB Colab T4 may be feasible. However, model weights are not the only memory requirement: the attention cache, input length, generated tokens, and software overhead also consume GPU memory. We will begin with short prompts and modest generation lengths, monitor GPU memory, and reduce the workload or use quantization if necessary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third, its licence supports our research.&lt;/strong&gt; Qwen3-4B-Instruct-2507 uses Apache 2.0, which permits use and modification subject to its conditions. We can download the model weights and run local inference through supported software without needing a paid inference API or API key. We must still follow the licence and any applicable platform requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fourth, it fits our existing workflow.&lt;/strong&gt; The model supports Hugging Face Transformers and uses a chat template for structured prompts. This allows us to build on our existing Python knowledge and keep the experiment manageable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Finally, its long context window provides room for larger prompts and additional instructions.&lt;/strong&gt; Our current poems do not require 262K tokens, but the capability is useful if we later experiment with longer creative-writing tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. How We Will Evaluate the Models
&lt;/h2&gt;

&lt;p&gt;To make our comparison fairer, we will use the same set of poem prompts for Tiny GPT, GPT-2, and Qwen3. We will keep the requested topics, poem lengths, and evaluation criteria consistent. Where possible, we will use comparable generation settings, while respecting each model's recommended configuration.&lt;/p&gt;

&lt;p&gt;We will evaluate each output using six criteria:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Relevance:&lt;/strong&gt; Does the poem stay on the requested topic?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structure:&lt;/strong&gt; Does it follow the requested number of lines or stanzas?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rhyme:&lt;/strong&gt; Does it follow the requested rhyme scheme?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coherence:&lt;/strong&gt; Do the lines connect logically?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grammar:&lt;/strong&gt; Is the language understandable and grammatically correct?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Creativity:&lt;/strong&gt; Does the poem use interesting descriptions and original ideas?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can use a simple scoring rubric, such as 1–5 for each criterion, and ask human reviewers to assess the results. We will report the actual scores after running the experiment rather than inventing results in advance. We will also record generation time and peak GPU memory usage to understand the practical cost of each model.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Limitations and Future Improvements
&lt;/h2&gt;

&lt;p&gt;Our comparison has several limitations. First, Tiny GPT, GPT-2, and Qwen3 differ in size, training data, and training methods. Therefore, differences in their output cannot be attributed to model architecture alone.&lt;/p&gt;

&lt;p&gt;Second, even an instruction-tuned model can ignore constraints, repeat phrases, or generate awkward rhymes. Fluency does not guarantee creativity or quality. Third, the models may reproduce biases or familiar patterns learned during training.&lt;/p&gt;

&lt;p&gt;Finally, Qwen3 requires more computing resources than Tiny GPT. If we want it to imitate the specific style of our poetry dataset, we could explore parameter-efficient fine-tuning, such as LoRA, if sufficient training data and hardware are available.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Our experiments with Tiny GPT and GPT-2 introduced us to Transformer-based text generation. Researching modern LLMs showed us that instruction tuning, training methods, model size, and context length can make a difference to how well a model responds to creative-writing requests.&lt;/p&gt;

&lt;p&gt;We chose Qwen3-4B-Instruct-2507 because it combines instruction-following capabilities, a permissive licence, compatibility with our Python workflow, and a model size that may fit our Colab environment with careful memory management.&lt;/p&gt;

&lt;p&gt;Our next step is to test it against Tiny GPT and GPT-2 using identical prompts and transparent evaluation criteria. This will help us determine whether the modern model actually improves our Poem Generator rather than relying on assumptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;OpenAI. &lt;strong&gt;GPT-2.&lt;/strong&gt; &lt;a href="https://github.com/openai/gpt-2" rel="noopener noreferrer"&gt;https://github.com/openai/gpt-2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Google. &lt;strong&gt;Gemma 3 Model Card.&lt;/strong&gt; &lt;a href="https://ai.google.dev/gemma/docs/core/model_card_3" rel="noopener noreferrer"&gt;https://ai.google.dev/gemma/docs/core/model_card_3&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Meta. &lt;strong&gt;Llama 3.2 Model Card.&lt;/strong&gt; &lt;a href="https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/MODEL_CARD.md" rel="noopener noreferrer"&gt;https://github.com/meta-llama/llama-models/blob/main/models/llama3_2/MODEL_CARD.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Microsoft. &lt;strong&gt;Phi-4 Mini Instruct.&lt;/strong&gt; &lt;a href="https://huggingface.co/microsoft/Phi-4-mini-instruct" rel="noopener noreferrer"&gt;https://huggingface.co/microsoft/Phi-4-mini-instruct&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Hugging Face. &lt;strong&gt;SmolLM3-3B.&lt;/strong&gt; &lt;a href="https://huggingface.co/HuggingFaceTB/SmolLM3-3B" rel="noopener noreferrer"&gt;https://huggingface.co/HuggingFaceTB/SmolLM3-3B&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Qwen Team. &lt;strong&gt;Qwen3-4B-Instruct-2507 Model Card.&lt;/strong&gt; &lt;a href="https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507" rel="noopener noreferrer"&gt;https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Vaswani, A., et al. (2017). &lt;strong&gt;Attention Is All You Need.&lt;/strong&gt; &lt;a href="https://arxiv.org/abs/1706.03762" rel="noopener noreferrer"&gt;https://arxiv.org/abs/1706.03762&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>computerscience</category>
      <category>llm</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>vision languige models</title>
      <dc:creator>Inezayimana Henriette</dc:creator>
      <pubDate>Mon, 26 Oct 2026 07:43:33 +0000</pubDate>
      <link>https://dev.to/ineza250/vision-languige-models-53lf</link>
      <guid>https://dev.to/ineza250/vision-languige-models-53lf</guid>
      <description>&lt;p&gt;Vision-Language Models: Teaching AI to See and Talk&lt;br&gt;
Show a photo of a crumpled bottle to a normal image classifier and it can only say "plastic" or "glass" from a fixed list. Show the same photo to a vision-language model and you can ask, "What is this made of, and can it be recycled?" It answers in plain sentences. That jump, from picking a label to understanding a picture in words, is what vision-language models (VLMs) are about.&lt;br&gt;
In this post I explain what VLMs are, the two main ways they are built, how they are trained, and where they still fail.&lt;br&gt;
What is a vision-language model?&lt;br&gt;
A VLM is a model that understands images and text together. You give it an image, some text, or both, and it can answer in text or tell you how well an image and a sentence match.&lt;br&gt;
The core problem is that an image is a grid of numbers with no words in it, and a sentence is a sequence of symbols with no pixels in it. A VLM has to connect the two. When it reads the word "bottle", it must link it to bottle-shaped patterns in the pixels. This is called grounding.&lt;br&gt;
Two building blocks you may already know&lt;br&gt;
• The image side: a computer vision model cuts the picture into small squares, called patches, and turns each square into a list of numbers.&lt;br&gt;
• The text side: a language model cuts the sentence into small pieces, called tokens, and turns each piece into a list of numbers.&lt;br&gt;
Now both the picture and the sentence are just lists of numbers. That is why they can be combined: the model only has to learn how the two kinds of lists relate to each other.&lt;br&gt;
Family 1: matching images and text (CLIP)&lt;br&gt;
CLIP, from OpenAI in 2021, has two encoders: an image encoder (a ViT) and a text encoder (a Transformer). Both map their input into the same vector space.&lt;br&gt;
It was trained on about 400 million image and caption pairs from the internet. In each training batch, CLIP:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Encodes all the images and all the captions.&lt;/li&gt;
&lt;li&gt;Compares every image with every caption, giving a table of similarity scores.&lt;/li&gt;
&lt;li&gt;Learns to give high scores to the correct pairs (the diagonal of the table) and low scores to all the wrong pairs.
This is called contrastive learning. Nobody had to label the images with classes, because the captions already describe them. Large batches matter because every other caption in the batch acts as a wrong example for each image.
The zero-shot trick
The best-known use of CLIP is zero-shot classification, which means classifying images without training on your labels:&lt;/li&gt;
&lt;li&gt;Write a sentence for each class, such as "a photo of a glass bottle" and "a photo of a cardboard box".&lt;/li&gt;
&lt;li&gt;Turn each sentence into a vector, and turn the image into a vector.&lt;/li&gt;
&lt;li&gt;Choose the class whose sentence vector is closest to the image vector.
To add a new class, you only write a new sentence. You do not need new labelled images or a new training run. The wording of the sentence still matters, and "a photo of a glass bottle" can work better than the bare word "glass".
Family 2: image tokens inside a language model (LLaVA and friends)
CLIP can compare, but it cannot write. Most modern assistants that can chat about images work differently, with three parts:&lt;/li&gt;
&lt;li&gt;A vision encoder, usually a pretrained ViT, that produces patch vectors.&lt;/li&gt;
&lt;li&gt;A connector (a small projection network) that translates those vectors into the language model's embedding space.&lt;/li&gt;
&lt;li&gt;A large language model (LLM) that reads the result and writes the answer one token at a time.
Here is a simple example. The picture is cut into 576 small squares. A small connector converts each square into the same kind of number list that the language model already understands. These converted squares are called visual tokens. The language model reads them first and your question second:
Picture (576 visual tokens) + question ("What material is this?") → the model writes the answer.
The language model does not know which pieces came from a picture. During training it learned that the first group of pieces describes a picture, and it uses them to write its answer.
There are other designs. BLIP-2 squeezes the picture into just a few tokens, which is cheaper but can lose small details. Flamingo lets the text layers look back at the picture while they write.
How these models are trained
A typical recipe for a generative VLM has two main stages:&lt;/li&gt;
&lt;li&gt;Learn to translate: keep the picture model and the language model fixed, and train only the connector on pictures with captions.&lt;/li&gt;
&lt;li&gt;Learn to follow instructions: train the language model on examples of a picture, a question and a good answer, such as "describe this picture".
While training, the model is graded only on the answer it writes. The picture and the question are just context.
What VLMs can do
• Describe an image in words (captioning).
• Answer questions about an image (visual question answering).
• Read text in photos, charts and documents.
• Classify images from text prompts, with no training on your labels.
• Search images using a sentence.
Where they still fail
VLMs are impressive, but they make mistakes that are worth knowing about:
• Making things up (hallucination). The language model has strong guesses about what usually appears in a scene. When the picture is unclear, those guesses can win, and it may describe an object that is not there.
• Counting. It is hard to count many small objects exactly.
• Position words. Words like "left of" and "behind" are only weakly understood.
• Small details. Tiny text and tiny objects can be lost, because the picture is shrunk to a fixed size. Some systems cut large pictures into pieces to help, which costs more computing power.
• Word order. CLIP-style models can confuse "a dog chasing a cat" with "a cat chasing a dog".
Cost matters too. More visual tokens mean more computing power and slower answers, so designers have to balance detail against cost.
Try it yourself
You can test CLIP on your own photos without writing any code. Any tool that lets you try CLIP works the same way:&lt;/li&gt;
&lt;li&gt;Pick a photo, for example a glass bottle.&lt;/li&gt;
&lt;li&gt;Write three or four short descriptions, such as "a photo of a glass bottle" and "a photo of a cardboard box".&lt;/li&gt;
&lt;li&gt;Ask CLIP which description fits the photo best. It gives each one a score.&lt;/li&gt;
&lt;li&gt;Change the wording and see how the scores change.
The wording matters, so you can learn a lot by changing the descriptions and watching how the scores move. It is a quick way to see how much the text side of the model shapes its answer.
Key takeaways
• A VLM connects images and text so that one system can work with both.
• CLIP matches images and captions in a shared space, and it can classify from text prompts alone.
• LLaVA-style models turn an image into visual tokens and feed them to a language model, which then writes the answer.
• Training usually aligns the connector first, then tunes the model on instructions.
• VLMs can hallucinate, miscount and miss small details, so their answers should be checked.
Vision Transformers gave computers a way to read images as sequences. Vision-language models take the next step and let those sequences meet language, which is why they are such an active area of AI right now.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>computer vision</title>
      <dc:creator>Inezayimana Henriette</dc:creator>
      <pubDate>Wed, 14 Oct 2026 09:26:53 +0000</pubDate>
      <link>https://dev.to/ineza250/computer-vision-mf0</link>
      <guid>https://dev.to/ineza250/computer-vision-mf0</guid>
      <description>&lt;p&gt;i learn how machines learn to see: a beginners guide to computer version &lt;br&gt;
so from pixels to predictions, and why its matters for africa&lt;br&gt;
 show your patterner a photo of a  dog have duck on the head  and he/she tell you what it is in a split second.  they  ever suggest if it is cute puppy.show the same photo to a computer and it sees something very different: a hugr grid of numbers.&lt;br&gt;
computer vision is the field of al that teaches a computers to turn those numbers into a meaning. in this post i walk through how it works, from a single pixel to models that can find buildings from space, using the experiments i ran in hands on notebook&lt;br&gt;
what computer vision ?&lt;br&gt;
for me is  to the computers get a meaning from images and video.&lt;br&gt;
almost every vision system answer one or more of three qwestion : what is any image if itis cat,a cassavaleaf,a bus.&lt;br&gt;
where it it? which pixels, which part of the picture&lt;br&gt;
what happening? person crossing the road, a crowd forming( especially in video)&lt;br&gt;
how computer sees a numbers:  a digital image is a grid of tiny sqweres called pixels.&lt;br&gt;
where each  pixel holds three numbers: how much red,green,and blue it contains,each from 0 to 255. so a small 400*600*3=720,000 numbers. a modern phone photo has more than 30 million. the computer never see "a dog". it only sees these numbers of a computer verision mis going from numbers to meaning.&lt;br&gt;
why 255? each value is stored in 8 bits, and 8 bits can hold 2 in 8 bits =255 different values, from 0 to 255. zero means none of that colour and 255 means full strength &lt;br&gt;
 my  work i tested the photo of a dog  in a babble bath, weearing  glasses with a yellow   robber duck on its head. i asked python to find the 10*10 patch of pixel with the most contrast, and it landed on the duck. one pixel there is full red, full green and almost no blue, and red plus green at full strength is exactly yellow .&lt;br&gt;
the computer had no idea it looking at a duck ,only at a very yellow set of numbers. a color image is rearly three grid stacked together one each for red, green and blue. in the duck blue grid the values are tiny becouse a yellow object contains almost no blue .&lt;br&gt;
how a computer find edges once you maths on them . &lt;br&gt;
the most important operation in computer vision is the filter. a small grid of weights that slides over the images. at each position you multiply the pixels under filter by its weights and add  everything up.&lt;br&gt;
 a famous example is the solber filter:&lt;/p&gt;

&lt;p&gt;-1   0    1&lt;br&gt;
-2   0    2&lt;br&gt;
-1   0    1&lt;br&gt;
it subtracts the left side&lt;br&gt;
from the right side . look at what happens on two small patches:&lt;br&gt;
. a flat patch where every pixel is 1000: the left side gives -400, the right side gives +400 and the total is 0 . no edge.&lt;br&gt;
.an edge patch where the left is 0 and the  right is 200: and the right is 200: the left give 0, the rigt gives +800, and the total is 800. a bright gives edge.&lt;br&gt;
so the filter light up exactly where brightness change sharply, whaich is what an edge is. flip the filter on its side and it finds horizontal edges instead. other filters blur or sharpen an image. the only difference between them is the numbers inside.&lt;br&gt;
From hand-made filters to CNNs&lt;/p&gt;

&lt;p&gt;Someone designed the Sobel filter by hand. A convolutional neural network (CNN) does the same sliding-and-adding, but nobody designs the filters. The network learns them from labelled examples using the same training loop as any other neural network.&lt;/p&gt;

&lt;p&gt;Researchers who look inside trained CNNs find a neat pattern: the first layers learn edges and colours, the middle layers learn textures and parts such as eyes or wheels, and the last layers respond to whole objects.&lt;/p&gt;

&lt;p&gt;Pixels, then edges, then textures, then objects.&lt;/p&gt;

&lt;p&gt;Five core tasks&lt;br&gt;
Classification: one label for the whole image.&lt;br&gt;
Detection: a box around each object.&lt;br&gt;
Segmentation: a label for every single pixel.&lt;br&gt;
OCR: reading text in images.&lt;br&gt;
Tracking: following objects across video frames.&lt;/p&gt;

&lt;p&gt;In my notebook I ran three of these on the same street photo using small pretrained YOLO models. The classifier gave one label, “minibus”, at 57% confidence. That is not wrong, but it is not very useful for a busy street. The detector found the bus and four people with boxes. The segmenter outlined exactly which pixels belonged to each object. More detailed output needs more detailed training labels, and those cost more to create.&lt;/p&gt;

&lt;p&gt;YOLO stands for You Only Look Once. Older detectors first proposed possible regions and then classified each one, which was accurate but slow. YOLO looks at the whole image in a single pass, which is fast enough for live video and small devices.&lt;/p&gt;

&lt;p&gt;Why is computer vision booming now?&lt;/p&gt;

&lt;p&gt;Five things came together:&lt;/p&gt;

&lt;p&gt;Cameras everywhere. Every phone is a camera and a small computer.&lt;br&gt;
Data. Huge image collections and satellite imagery.&lt;br&gt;
Compute. Cloud GPUs for training, and small models that run on phones.&lt;br&gt;
Pretrained models. You do not start from zero. You can adapt an existing model with a few thousand local photos.&lt;br&gt;
Multimodal AI. Assistants can now read images as well as text. A Vision Transformer even cuts an image into 16 × 16 patches and treats each patch like a word.&lt;br&gt;
Computer vision across Africa&lt;/p&gt;

&lt;p&gt;This is the part that excites me most. Some examples from the course material:&lt;/p&gt;

&lt;p&gt;Agriculture: Nuru helps farmers diagnose cassava diseases from a leaf photo, offline, on a basic phone.&lt;br&gt;
Health: In Nigeria, software scored chest X-rays to decide who should get a lab test for tuberculosis. In one project covering 5,298 people, 85 TB cases were found.&lt;br&gt;
Conservation: In Gabon, smart camera traps spot elephants and people and alert rangers by satellite within minutes.&lt;br&gt;
Finance: Smile ID matches a selfie to an ID photo and checks that it is a real, live person.&lt;br&gt;
Mapping: Google’s Open Buildings dataset outlines about 1.8 billion buildings, helping with vaccination planning and disaster response.&lt;br&gt;
Accessibility: BLAIVA, built by FabLab Rwanda and still in beta, is a wearable camera that describes objects, text and faces through earphones.&lt;/p&gt;

&lt;p&gt;That last one was built in Kigali. It is a reminder that the people reading this can build these systems too.&lt;/p&gt;

&lt;p&gt;When models fail&lt;/p&gt;

&lt;p&gt;A model only knows what it was trained on. To see this, I made the street photo harder in three ways: very dark, upside down and very low resolution. These are everyday conditions with cheap phones, poor lighting or a dusty lens. The detector’s results changed in each case. In one it even invented an object that was not there.&lt;/p&gt;

&lt;p&gt;This matters because most popular models were trained mostly on photos from Europe, North America and Asia. They can struggle with African crops, clothing, road scenes, skin tones and lighting. For a face-verification system, a missed match is an inconvenience. For a medical screening tool, a wrong answer could harm someone. The fix is local data and fine-tuning, and being honest about how a model was test&lt;br&gt;
Try it yourself&lt;/p&gt;

&lt;p&gt;You only need a free Google Colab account:&lt;/p&gt;

&lt;p&gt;Load a photo with Python and print its shape. Notice that it is height × width × 3.&lt;br&gt;
Print the red, green and blue values of one pixel.&lt;br&gt;
Pick the 10 × 10 patch with the most contrast and look at its numbers.&lt;br&gt;
Run a Sobel filter and watch the edges appear.&lt;br&gt;
Run a pretrained YOLO model on your own photos, and keep one hit and one miss.&lt;/p&gt;

&lt;p&gt;Try a photo of your street, a market or a plant leaf. Where does the model succeed, and where does it fail?&lt;/p&gt;

&lt;p&gt;Final thoughts&lt;/p&gt;

&lt;p&gt;Computer vision looks like magic until you see what is inside: images are numbers, filters find patterns in those numbers, and networks learn which patterns matter. Once you understand that chain, you can start building tools that solve problems close to home, from crop disease to accessibility.&lt;/p&gt;

&lt;p&gt;The next time you glance at a photo and instantly know what it shows, remember that a computer needs millions of numbers and a lot of training to do the same.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>machinelearning</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>words embeddings</title>
      <dc:creator>Inezayimana Henriette</dc:creator>
      <pubDate>Wed, 30 Sep 2026 14:57:00 +0000</pubDate>
      <link>https://dev.to/ineza250/words-embeddings-4pf4</link>
      <guid>https://dev.to/ineza250/words-embeddings-4pf4</guid>
      <description>&lt;p&gt;words embeddings are a way of representing a words as numbers(a vectors) so that the computer can understand the relationship and similalities  between words, &lt;br&gt;
the vectors usually 50 to 300 numbers long. These numbers are learned from large amounts of text, and they place words with similar meanings close to each other.&lt;br&gt;
why  words embedding is matters to help computer to understands human languege becouse computes hear only numbers. ex on map, cities that are near each other are similar in location. In an embedding space, words that are near each other are similar in meaning. "Doctor" ends up close to "nurse" and "hospital", and far from "bride".&lt;br&gt;
the simplest way is bag-of- word  is a way to converting text into a numbers so a computer can process it where each words gets its own position in a long list ,and we count  how is appears. example   "i love my school" on this  computer convert it like ,i:1, love:1,my:1 school:1 [1,1,1,1} this what computer receive , related method is tf-idf,which gives more weight to rare, informative words. both work, but they have a big weakness:they don&lt;code&gt;t understand meaning becouse they count words they don&lt;/code&gt;t care the meaning of words.&lt;br&gt;
in bag-of-words, "good" and "great" are as different as "good" and "banana". It treats every word as a separate item with no connection to any other.&lt;br&gt;
how  word2vec works  on high levels&lt;br&gt;
 first  Word2Vec was created at Google in 2013.it trains a small neural network  on task like predicting words and  find their neighbours&lt;br&gt;
 and also the words embedded  its capture meaning of the word not spelling  and also  a model trained on one tsk can reuse embedding that were learned from high amount of text even if your dataset is small it help you for that &lt;br&gt;
how it work&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;they look at the neghbours: it read  a lot of text and slides asmall window across eachStep 1: Look at the neighbours.
Word2Vec reads a lot of text and slides a small window across each sentence. Take the sentence:"I drink hot coffee every morning"For the word coffee with a window of 2, the neighbours are: drink, hot, every, morning. These pairs (coffee → drink, coffee → hot, and so on) become the training examples.
2: Give every word random numbers.
At the start, each word gets a vector of random numbers. These numbers mean nothing yet.
3: Practise a prediction game.
A small neural network tries to guess words from their neighbours. There are two versions of the game:
v1:continous bag of words  they try to predict the middle word  colles the target words ex "i love cuckies " the target will be the "love"  so you have to find love inorder to fill a sentences "i -cockies" they have  need love to fill the sentence  this it predit it
v2.skip-gram they trie to predict the sarrounding words  you get a middle input  ex :i love  this it find cockies depend on "i love cockies" CBOW is faster compare  skip-gram works better for rare words
4: Learn from mistakes.
Each time the network guesses wrong, it adjusts the word vectors slightly. After millions of sentences, words used in similar contexts end up with similar vectors. Coffee and tea both appear near drink, hot and cup, so their vectors move close together.
5: Keep the vectors, throw away the game.
We don't care about the predictions. The learned vectors are the useful result, and they are the word embeddings.
on training model i got code  from chart gbt
from gensim.models import Word2Vec&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;sentences = [&lt;br&gt;
    ["i", "drink", "hot", "coffee", "every", "morning"],&lt;br&gt;
    ["she", "drinks", "hot", "tea", "every", "morning"],&lt;br&gt;
    ["he", "drives", "a", "car", "to", "work"],&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;model = Word2Vec(&lt;br&gt;
    sentences,&lt;br&gt;
    vector_size=50,   # length of each word vector&lt;br&gt;
    window=2,         # how many neighbours to look at&lt;br&gt;
    min_count=1,      # keep all words&lt;br&gt;
    sg=1              # 1 = Skip-gram, 0 = CBOW&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;print(model.wv["coffee"])                    # the vector for "coffee"&lt;br&gt;
print(model.wv.most_similar("coffee"))       # closest words&lt;br&gt;
what i learned  and what suprise me&lt;br&gt;
 first what it`s suprise me how computer understand our  sentences or words in mathematics lic to convert it  with encording  as numbers and decording  as a word or answer   that make a sence i also learn  the method of embedding  called word2vec how it work depend on   what they look at the neighbour of the word lik i drink hot coffee and give   word a random number  and even how it train it&lt;br&gt;&lt;br&gt;
what supprise me  is how you can do a math with a words&lt;br&gt;
i run this analogy&lt;br&gt;
king -man+woman=Qween &lt;br&gt;
the model was never taught what a king or a queen is. It only read a lot of text, and it still found the right answer. I didn't expect a computer to pick up relationships like this on its own&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
  </channel>
</rss>
