<?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 Ahmet Ger on Medium]]></title>
        <description><![CDATA[Stories by Ahmet Ger on Medium]]></description>
        <link>https://medium.com/@ahmet.ger?source=rss-cd8617c36483------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Ahmet Ger on Medium</title>
            <link>https://medium.com/@ahmet.ger?source=rss-cd8617c36483------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 07:12:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ahmet.ger/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[Do We Really Always Need the Big Embedding Models? A Deep Dive into Gemini vs. BERT]]></title>
            <link>https://medium.com/@ahmet.ger/do-we-really-always-need-the-big-embedding-models-a-deep-dive-into-gemini-vs-bert-82433df8bbf2?source=rss-cd8617c36483------2</link>
            <guid isPermaLink="false">https://medium.com/p/82433df8bbf2</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[benchmarking]]></category>
            <category><![CDATA[bert]]></category>
            <category><![CDATA[word-embeddings]]></category>
            <dc:creator><![CDATA[Ahmet Ger]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 13:08:05 GMT</pubDate>
            <atom:updated>2025-08-12T13:08:05.497Z</atom:updated>
            <content:encoded><![CDATA[<p>When it comes to semantic search, question answering, or any task that requires measuring the similarity between two pieces of text, <strong>embedding models</strong> are often the silent workhorses running in the background.</p><p>If you’ve used an LLM-powered search tool or a recommendation system that “understands” meaning, chances are embeddings were involved.</p><p>For many, the default choice has been to call an API from a <strong>big-name provider</strong> — OpenAI’s text embeddings, Google’s Gemini embeddings, or Cohere’s multilingual embeddings.</p><p>But do we really <em>always</em> need these heavyweight, proprietary models?</p><p>Recently, I decided to explore this question by comparing <strong>Gemini’s latest embedding model</strong> against an open-source <strong>Turkish BERT</strong> model. The results surprised me — not just because of the scores, but because of what they imply about how we build NLP pipelines.</p><h3>1. Embeddings in Plain Language</h3><p>Before diving into the results, let’s make sure we’re on the same page.</p><p>An <strong>embedding</strong> is a numerical representation of a piece of text (or other data) in a <strong>high-dimensional space</strong>. Think of it as assigning every sentence a precise “address” in a giant semantic map.</p><ul><li>If two sentences mean the same thing, their embeddings will be close together.</li><li>If they have different meanings, they’ll be far apart.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oQx5TrAEGe9Rpcrk.png" /></figure><h3>How They’re Created</h3><p><strong>1. Tokenization</strong></p><p>Your text is split into tokens — words, subwords, or even characters depending on the tokenizer.</p><p><strong>2. Transformer Encoding</strong></p><p>These tokens are passed through a transformer-based neural network that uses self-attention to capture meaning and relationships between tokens.</p><p><strong>3. Pooling</strong></p><p>The token-level representations are combined (mean pooling, CLS token, etc.) into a single fixed-length vector.</p><p><strong>4. Output Vector</strong></p><p>This vector — often 768 to several thousand dimensions — is your embedding.</p><p><strong>5. Similarity Measurement</strong></p><p>When you want to compare two texts, you take their embeddings and calculate <strong>cosine similarity</strong> (or dot product) to see how close they are in meaning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p7Hj7pf5zrduI_ss.png" /></figure><h3>2. The Standard Choice vs. Building Your Own</h3><p>Using a service like <strong>OpenAI’s text-embedding-3-large</strong> or <strong>Gemini’s latest embedding model</strong> has advantages:</p><ul><li>Multilingual training on enormous datasets</li><li>Architecture optimized for semantic accuracy</li><li>High performance without any setup</li></ul><p>But these models come with trade-offs:</p><ul><li><strong>Cost</strong> — every call is billed per token</li><li><strong>Privacy</strong> — data passes through a third-party API</li><li><strong>Customization limits</strong> — you can’t fine-tune the model on your domain easily</li></ul><p>The alternative is to <strong>architect your own embedding pipeline</strong> using an open-source model like <strong>BERT</strong> or <strong>SBERT</strong>. This means:</p><ul><li>Running the model locally or on your own server</li><li>Having complete control over preprocessing, storage, and retrieval</li><li>Potentially saving costs if usage is high</li></ul><h3>3. Designing a BERT-based Embedding Pipeline</h3><p>Here’s how you can build a pipeline that rivals proprietary embeddings in many use cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BxcVzUH_R9LdZdH-NOsOSQ.png" /></figure><h4><strong>Step 1: Model Selection</strong></h4><p>Pick a model trained for your language and task. For Turkish semantic similarity, emrecan/bert-base-turkish-cased-mean-nli-stsb-tr on Hugging Face is an excellent choice — it’s trained on Turkish Natural Language Inference and Semantic Textual Similarity datasets.</p><h4><strong>Step 2: Preprocessing</strong></h4><p>Normalize and clean your text before embedding:</p><ul><li>Lowercase (if the model isn’t cased-sensitive)</li><li>Handle diacritics and Turkish-specific characters correctly</li><li>Remove unnecessary whitespace</li></ul><h4><strong>Step 3: Chunking for Long Inputs</strong></h4><p>BERT has a <strong>512 token limit</strong>. For long documents:</p><ul><li>Split into overlapping segments (e.g., 300 tokens with 50-token overlap)</li><li>Embed each chunk individually</li><li>Later, aggregate these embeddings (average, max pooling, or attention-weighted pooling)</li></ul><h4>Step 4: Store in a Vector Database</h4><p>Use a vector search system to store and retrieve embeddings efficiently:</p><ul><li><strong>FAISS</strong> — highly optimized C++/Python library</li><li><strong>ChromaDB</strong> — lightweight, developer-friendly</li><li><strong>Weaviate</strong>, <strong>Pinecone</strong> — managed services with scaling options</li></ul><h4>Step 5: Retrieval</h4><p>When you get a query:</p><ul><li>Embed it using the same BERT model</li><li>Search the vector DB for the most similar embeddings</li><li>Return relevant chunks/documents</li></ul><h4>Step 6: Integrate with Applications</h4><p>This architecture can power:</p><ul><li>Semantic search engines</li><li>Question-answering systems</li><li>RAG pipelines for LLMs</li><li>Similarity-based recommendation systems</li></ul><h3>4. The Benchmark: Gemini vs. Turkish BERT</h3><p><strong>The experiment</strong></p><p>I compared:</p><ul><li><strong>Gemini Text Embedding (latest model)</strong> — marketed as one of the best globally.</li><li><strong>Turkish BERT</strong> — emrecan/bert-base-turkish-cased-mean-nli-stsb-tr.</li></ul><p><strong>The task</strong></p><p>For a set of Turkish questions, I took:</p><ul><li>The correct answer</li><li>The LLM-generated answer</li></ul><p>…then computed cosine similarity between their embeddings.</p><p><strong>Results:</strong></p><ul><li>Gemini: <strong>0.97</strong></li><li>Turkish BERT: <strong>0.91</strong></li></ul><p>A mere <strong>0.06 difference</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eGwJr5jt7_uISgQvaQjbvA.png" /></figure><h3>5. Why This is Significant</h3><p>That small gap tells a big story:</p><ul><li>Proprietary models aren’t <em>always</em> miles ahead — especially in single-language, well-defined tasks.</li><li>With proper preprocessing, chunking, and a well-chosen open-source model, you can get <em>very close</em> to the “state-of-the-art” without API costs.</li></ul><h3>6. Making It Accessible: n8n Workflow</h3><p>To prove this could be usable for <strong>non-developers</strong>, I built an <strong>n8n workflow</strong>:</p><ul><li>Users paste in a question and its correct answer</li><li>Select which embedding model to use</li><li>Workflow automatically generates embeddings and calculates cosine similarity</li><li>Results appear instantly — no code required</li></ul><p>This means that even non-technical teams can run semantic similarity evaluations without touching Python.</p><h3>7. Final Thoughts</h3><p>Embeddings are the foundation of many AI-powered features, but that doesn’t mean you must always default to the most expensive option.</p><p>By understanding <strong>how embeddings work</strong> and <strong>how to build your own pipeline</strong>, you gain flexibility, reduce costs, and maintain control over your data.</p><p><strong>#AI #ArtificialIntelligence #MachineLearning #ML #DeepLearning #NaturalLanguageProcessing #NLP #LLM #Embeddings #VectorSearch #SemanticSearch #OpenSource #HuggingFace #BERT #Gemini #AIModels #LanguageModels #DataScience #DataScienceCommunity #AICommunity #TurkishNLP #CosineSimilarity #VectorDatabase #AIResearch #MLOps #TechCommunity #AITurkey #LLMBenchmark #SemanticAI #n8n #WorkflowAutomation</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82433df8bbf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Exploring Real-Life Applications of Advanced Algorithms ]]></title>
            <link>https://medium.com/@ahmet.ger/exploring-real-life-applications-of-advanced-algorithms-559f5192040d?source=rss-cd8617c36483------2</link>
            <guid isPermaLink="false">https://medium.com/p/559f5192040d</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Ahmet Ger]]></dc:creator>
            <pubDate>Thu, 08 Aug 2024 13:52:41 GMT</pubDate>
            <atom:updated>2024-08-08T13:52:41.041Z</atom:updated>
            <content:encoded><![CDATA[<p>As a computer engineering student with a keen interest in machine learning and artificial intelligence, I’ve always been fascinated by the powerful impact of algorithms on real-world problems. Today, I want to share some intriguing applications of advanced algorithms that shape our world and the inspiration behind them!</p><p><strong>🧬 Genetic Algorithms (GA)</strong></p><p>Genetic algorithms are optimization and search heuristics that mimic the process of natural selection. They use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover. The algorithm starts with a population of randomly generated candidates, and through iterative processes, evolves these candidates to find optimal or near-optimal solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*sAOTFVLAOPVShU0nJSq24w.png" /><figcaption>genetic algorithm</figcaption></figure><p>🔹 <strong>Aerospace Engineering</strong>: NASA utilized genetic algorithms to design an antenna for the ST5 spacecraft. By evolving the design through iterative processes, NASA produced efficient and unique designs that were more effective than traditional methods .</p><p>🔹 <strong>Telecommunications</strong>: Genetic algorithms optimize the placement and routing of cell towers to improve coverage and reduce interference. This dynamic routing enhances communication networks and overall connectivity .</p><p>🔹 <strong>Machine Learning</strong>: In machine learning, genetic algorithms are employed for hyperparameter tuning, evolving neural networks, and feature selection. This approach allows models to adapt and improve over time, enhancing their predictive capabilities .</p><p>🔹 <strong>Mechanical Engineering</strong>: Genetic algorithms excel in designing mechanical components, such as optimizing the lift-to-drag ratio in aircraft wing designs. This multidisciplinary problem-solving approach ensures that designs meet specific performance criteria effectively .</p><p><strong>🐜 Ant Colony Optimization (ACO)</strong></p><p>Ant colony optimization algorithms are inspired by the foraging behavior of ants. Ants deposit pheromones on paths leading to food sources, and other ants follow these pheromone trails to find the shortest paths. ACO mimics this behavior to find optimal solutions to complex problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*AE529e7WXfjAqD7unjYsJA.png" /></figure><p>🔹 <strong>Logistics and Supply Chain Management</strong>: ACO has revolutionized the logistics industry by optimizing delivery routes and supply chains. Companies like Amazon and UPS use these algorithms to ensure timely and cost-effective deliveries .</p><p>🔹 <strong>Network Routing</strong>: In telecommunications, ACO helps manage network traffic efficiently, ensuring data packets take the best possible routes to avoid congestion and minimize delays. This is crucial for maintaining the quality of service in internet and mobile networks .</p><p>🔹 <strong>Public Transportation Systems</strong>: Urban planners use ACO to design and manage public transportation routes, reducing travel time and improving the efficiency of bus and train networks. This makes public transport a more attractive option for commuters .</p><p><strong>❄️ Simulated Annealing (SA)</strong></p><p>Simulated annealing is an optimization technique based on the principles of metallurgy and material science. It simulates the cooling process of metals to find the global minimum in a search space. The algorithm starts at a high temperature and gradually cools down, allowing the system to escape local optima and find a near-optimal solution.</p><p>🔹 <strong>VLSI Design</strong>: SA is used in the design of very-large-scale integration (VLSI) circuits, optimizing the placement and routing of components on a chip to minimize delays and power consumption. This is essential for creating efficient and high-performance electronic devices.</p><p>🔹 <strong>Image Processing</strong>: In image processing, SA aids in tasks like image segmentation and edge detection. By optimizing parameters and minimizing the error rate, this algorithm enhances the accuracy and quality of image analysis.</p><p>🔹 <strong>Industrial Engineering</strong>: SA is also used to optimize complex industrial processes, such as scheduling and resource allocation. By finding near-optimal solutions, SA helps improve efficiency and reduce operational costs.</p><p><strong>🌍 Traveling Salesman Problem (TSP)</strong></p><p>The Traveling Salesman Problem is a classic combinatorial optimization problem that seeks the shortest possible route visiting a set of cities and returning to the origin. TSP has extensive applications in various fields due to its complexity and relevance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*2O7Zo6Od-tkEMxzua_dDeQ.png" /></figure><p>🔹 <strong>Route Planning</strong>: Logistics companies use TSP algorithms to plan the most efficient delivery routes, reducing travel time and fuel consumption. This not only saves costs but also minimizes the environmental impact of transportation.</p><p>🔹 <strong>Genome Sequencing</strong>: In bioinformatics, TSP algorithms help arrange DNA sequences in the correct order, which is crucial for understanding genetic information and developing medical treatments.</p><p>🔹 <strong>Circuit Board Design</strong>: Engineers use TSP algorithms to optimize the layout of components on a circuit board, minimizing the length of connections and improving the performance of electronic devices.</p><p><strong>Additional Real-Life Inspirations</strong></p><p>🔹 <strong>Biomimetic Invention</strong>: Genetic algorithms have inspired biomimetic designs, where engineers create technology based on biological principles. Examples include robotic limbs that mimic animal movements and structures that emulate natural forms for efficiency and strength.</p><p>🔹 <strong>Computer Gaming</strong>: In game development, genetic algorithms are used to create intelligent AI opponents and procedurally generate game content. This ensures a dynamic and engaging player experience by adapting to individual player strategies.</p><p>🔹 <strong>Medical Science</strong>: Genetic algorithms play a crucial role in drug discovery and medical diagnostics. They help in predicting protein structures, optimizing drug formulations, and personalizing medical treatments based on genetic data.</p><p><strong>Conclusion</strong></p><p>Engineers have always drawn inspiration from the natural world and everyday challenges to devise algorithms that tackle complex problems. From the organization of street layouts to the design of efficient building structures, these real-life algorithms play a crucial role in shaping our environment. The applications of these algorithms are vast and varied, impacting industries from aerospace to healthcare, and transforming the way we solve problems.</p><p>As I continue my journey in tech, I’m excited to explore and contribute to the fascinating world of algorithms, inspired by the brilliance of nature and human ingenuity.</p><p>Let’s connect and discuss more about these amazing algorithms and their potential! 💡🤝</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=559f5192040d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>