<?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 Herman Jangsett Mostein on Medium]]></title>
        <description><![CDATA[Stories by Herman Jangsett Mostein on Medium]]></description>
        <link>https://medium.com/@mosteinherman?source=rss-8bbf96154c94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2l11ryWLzX1HQjwaw6HxPw.jpeg</url>
            <title>Stories by Herman Jangsett Mostein on Medium</title>
            <link>https://medium.com/@mosteinherman?source=rss-8bbf96154c94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:47:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mosteinherman/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[Loss Functions and Their Origins]]></title>
            <link>https://medium.com/data-science-collective/loss-functions-and-their-origins-5d4258bce317?source=rss-8bbf96154c94------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d4258bce317</guid>
            <category><![CDATA[math]]></category>
            <category><![CDATA[space]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Herman Jangsett Mostein]]></dc:creator>
            <pubDate>Wed, 01 Oct 2025 21:35:15 GMT</pubDate>
            <atom:updated>2025-10-03T06:35:19.904Z</atom:updated>
            <content:encoded><![CDATA[<h4>A look at how we derive loss functions in machine learning and how they relate to celestial discovery</h4><figure><img alt="AI generated image of a lonely planet in the vast darkness of space" src="https://cdn-images-1.medium.com/max/1024/1*02fC0GVeVhtMcIRjX8jSFA.png" /><figcaption>Generated by ChatGPT</figcaption></figure><p>In 1801, astronomer Giuseppe Piazzi discovered a planet-like object, which we know today as Ceres. This celestial body was observed for 40 days, with astronomers recording its position as frequently and accurately as possible. On the 41st day, Ceres disappeared behind the Sun, making it impossible to track its position. How would the astronomers find Ceres again? That question would soon be answered by the 24-year-old Carl Friedrich Gauss.</p><p>He assumed that the errors in the collected data could be described by a Gaussian, and found out that the path that minimizes the <strong>Mean Squared Error (MSE)</strong> of all the datapoints would be Ceres’ most likely path.</p><p>This innovation inspires how we draw conclusions from data today. In this article, we will see exactly why MSE is tied to Gauss’ assumption and how this method laid the groundwork for some of the most fundamental tools in machine learning today.</p><h3>Empirical Risk Minimization</h3><p>Most modern machine learning is based on <strong>Empirical Risk Minimization (ERM)</strong>. This framework phrases a learning task as an optimization problem, defining a risk that we want our model to minimize over our training data. The risk is the expectation value of a <strong>loss function</strong>, a function quantifying the error of our model on the training set. So if the model makes a lot of mistakes, that gives a high value of our loss function, thus a high risk.</p><p>The idea behind ERM is that if our model performs well on the training data, this will generalize to other data as well.</p><p>Most experienced machine learning practitioners understand how loss functions work. The fact that minimizing the loss brings predictions closer to the targets is an intuitive idea. But there is more to it. Why do we use Mean Squared Error instead of, say, Mean Cubed Error?</p><h3>Maximum Likelihood Estimation</h3><p>Assume you have a dataset, and that there is some model that can generate this data. This could be, for example, a model that creates labels for images or a generative model creating text. You can think of the dataset as “data points the model has already generated,” and you want to find out how the model achieved this. What model parameters would allow the model to create this data? There is some randomness involved, and many different models could, in theory, generate the same dataset.</p><p>We want to identify the model that is most likely to have generated the dataset. We therefore want to find the parameters that maximize the following likelihood.</p><figure><img alt="The model likelihood as a product of conditionals." src="https://cdn-images-1.medium.com/max/1024/1*8JYtZMkHfqo5KDpkPYJRfg.png" /><figcaption>The model likelihood as a product of conditionals.</figcaption></figure><p>The function L represents the probability that the model θ generates the dataset D, consisting of x and y pairs. Maximizing this function yields the model that is most likely to have generated the dataset.</p><p>There are some practical problems with this approach, the main one being the multiplication of probabilities. Even if a model generates a data point with high likelihood (say 99%), multiplying across 100,000 points produces an extremely small value. Such values are inconvenient to represent on a computer, so we need a workaround.</p><p>The standard solution is to take the logarithm of the probabilities, which transforms the expression into the following form.</p><figure><img alt="The logarithm of the product of conditionals becomes a sum." src="https://cdn-images-1.medium.com/max/1024/1*Qqz8vFFuPGiydrVTsdmMAA.png" /><figcaption>The logarithm of the product of conditionals becomes a sum.</figcaption></figure><p>Why is this valid, and why is it useful? The logarithm is a strictly increasing function that preserves ordering. Maximizing the likelihood is therefore equivalent to maximizing its logarithm. There are three central advantages to this approach:</p><ul><li><strong>Additivity.</strong> Instead of multiplying probabilities and producing extremely small values, we can take their sum, avoiding this magnification effect.</li><li><strong>Numerical stability.</strong> Taking the logarithm replaces tiny probability values with more manageable negative values.</li><li><strong>Optimization convenience.</strong> Differentiating products is cumbersome, while sums can be differentiated term by term. This allows for simpler computation of gradients in gradient-based algorithms. The logarithm also tends to produce smoother objective functions.</li></ul><p>In optimization, there is a general convention to use minimization rather than maximization. Since the two are equivalent — you can flip the sign of the objective function to switch between them — we take the negative log likelihood, which turns the task into a minimization problem. This gives us the following objective:</p><figure><img alt="Equation for the Negative Log Likelihood" src="https://cdn-images-1.medium.com/max/1024/1*o2m13btFBL-GS8vxmNqOuw.png" /><figcaption>Equation for the Negative Log Likelihood</figcaption></figure><p>If we can find the model that minimizes this value, we obtain the model most likely to have generated our dataset, making it the “best” model.</p><p>This is fine, but how do we solve this minimization problem? How do we find these probabilities?</p><h3>Loss functions</h3><p>Optimizing the negative log likelihood exactly is difficult in practice. The search space is large, making it very hard to find the exact best model parameters. This is why we use gradient descent and other iterative methods to find the model parameters.</p><p>One trick we can do to simplify the search for an appropriate model is to make some assumptions.</p><h4>MSE and Negative Log Likelihood Loss</h4><p>Let us assume that, given a certain model, the prediction errors are normally distributed. This means that we can interpret the model&#39;s predictions as the mean of this distribution, as well as the variance of the error distribution. This can be written as</p><figure><img alt="The Gaussian with predicted mean and variance" src="https://cdn-images-1.medium.com/max/1024/1*nGiAPqsD34CVlyiYyLV6eg.png" /><figcaption>The Gaussian with predicted mean and variance</figcaption></figure><p>This represents the likelihood of our model given a dataset. Now, let us take the negative log likelihood of this.</p><figure><img alt="The Negative Log Likelihood loss function" src="https://cdn-images-1.medium.com/max/1024/1*oDYqP-wcdG0dEDWc99dwZg.png" /><figcaption>The Negative Log Likelihood loss function</figcaption></figure><p>This is the famous <strong>Gaussian Negative Log Likelihood (NLL) </strong>loss function! It minimizes both the squared difference between the prediction mean and the targets, as well as the variance of the error distribution. This makes our model predict the targets accurately, with little noise in its predictions.</p><p>This loss function works well for quantifying uncertainty with our model. The model can predict a variance, which indicates uncertainty in the data. The NLL loss function minimizes not only the squared difference between prediction and target but also the predicted variance. In addition, the squared difference between the target and prediction is scaled by the inverse of the variance. This means that if the model cannot predict the targets accurately, it can minimize the loss by increasing the predicted variance.</p><p>What if we assume that the variance of the errors does not depend on x, meaning they are constant? Under this assumption, the second term in the above equation becomes constant, meaning it does not affect our optimization problem. This means that we can simply remove the variance terms from the objective function, giving us the following expression.</p><figure><img alt="The Mean Squared Error Loss" src="https://cdn-images-1.medium.com/max/1024/1*-XUx5uTi23rlMVQ20LaN2A.png" /><figcaption>The Mean Squared Error Loss</figcaption></figure><p>You probably recognize this as the Mean Squared Error loss, the most frequently applied loss function in machine learning.</p><figure><img alt="A graph showing the similarity of NLL and MSE with Error" src="https://cdn-images-1.medium.com/max/842/1*Q870xERMeQ1xUIaiKivXrA.png" /><figcaption>The plot shows that Mean Squared Error (blue) and Gaussian Negative Log Likelihood with fixed variance (red) have the same shape — they both penalize errors quadratically. This illustrates that MSE is just a special case of NLL when we assume normally distributed errors with constant variance.</figcaption></figure><p>While Gauss did not use the same mathematical language as we do today, this was exactly the insight that allowed him to compute the most likely path of Ceres. He observed that when the square of the difference between the prediction and the target was minimized, it maximized the likelihood of the celestial path, much like we do for the parameters of our ML model.</p><h4>Laplace</h4><p>In much the same way as the Gaussian assumptions give rise to the MSE, we can also derive <strong>Mean Absolute Error (MAE)</strong> from the <strong>Laplace distribution</strong>.</p><p>The Laplace distribution was formulated by Pierre-Simon Laplace, a mathematician living around the same time as Gauss, both of whom worked on celestial bodies. It is said that Laplace was once asked by Napoleon Bonaparte why he did not include God in his work on the universe, to which he answered, “I had no need for that hypothesis”. Napoleon was amused by this answer and passed it on to Joseph Lagrange, who commented, “Ah, it is a fine hypothesis; it explains so many things.”</p><p>Just as Laplace had no need for divine hypotheses, we can obtain important results without the Gaussian assumption. If we assume that the model error does not lie on a Gaussian, but rather on a Laplace distribution instead, we end up with the MAE by negative log likelihood. The Laplace distribution is given by the following equation,</p><figure><img alt="The Laplace distribution" src="https://cdn-images-1.medium.com/max/1024/1*44L7SH7hNQBtfVFH8z4CEQ.png" /><figcaption>The Laplace distribution</figcaption></figure><p>This distribution is heavier on the tail than is the Gaussian, which makes outliers more likely. This intuition can also be found in the MAE, as it penalizes large deviations less than does MSE.</p><p>If we take the negative log likelihood of the Laplace distribution and ignore the scalars, it provides us with the following function</p><figure><img alt="The Mean Absolute Error loss funciton" src="https://cdn-images-1.medium.com/max/1024/1*-Er9ZQs3HnjTy6khywJlyA.png" /><figcaption>The Mean Absolute Error loss funciton</figcaption></figure><p>This can be recognized as the MAE.</p><figure><img alt="A graph showing the difference between the rounded Gaussian vs the more pointed Laplace distribution" src="https://cdn-images-1.medium.com/max/1024/1*Ly2bClhGEs7BFvymegVInQ.png" /><figcaption>The <strong>Gaussian</strong> (blue) has a smoother, bell-shaped curve, while the <strong>Laplace</strong> (red dashed) has a sharper peak at the center and heavier tails. This is why Laplace noise leads to MAE being more robust to outliers — the distribution “expects” large deviations more often than the Gaussian does.</figcaption></figure><p>Let us go through what we have seen so far. We can use maximum likelihood estimation to find a model to fit our data. To ease optimization and computation during this process, we usually apply the negative logarithm to the likelihood. Now, by assuming that the errors from our model are normally distributed and have constant variance, we end up with the MSE. If we assume a Laplace distribution, we get the cousin of MSE, namely MAE. This means that both MSE and MAE are simply maximum likelihood estimation under the hood.</p><h4>KL-divergence</h4><p>So far, we have only seen negative log likelihood as a practical extension of maximum likelihood estimation, but it is also connected to the information-theoretical measure <strong>KL-divergence</strong>. This measure is used to find the closeness of two probability distributions, and is given by the following expression.</p><figure><img alt="The KL-divergence" src="https://cdn-images-1.medium.com/max/1024/1*oeTieiwYuuou6u1_EtfH8g.png" /><figcaption>The KL-divergence</figcaption></figure><p>This can equivalently be written as such:</p><figure><img alt="The KL-divergence rewritten" src="https://cdn-images-1.medium.com/max/1024/1*ZSE66dVQgVz_RbRV0ASvIQ.png" /><figcaption>The KL-divergence rewritten</figcaption></figure><p>We can use the KL-divergence to find a model to fit our data. We can look at P as the distribution of our data, or the true target distribution, and Q as the output distribution of our model. If we minimize the KL-divergence between these distributions, they will become similar, and we will have found a model that fits our data.</p><p>Minimizing the expression above with regard to θ allows us to remove the first term, as it does not depend on θ. This gives us the following.</p><figure><img alt="The KL-divergence with first term removed" src="https://cdn-images-1.medium.com/max/1024/1*mEK5RE-nTr00tSZuVIVMUQ.png" /><figcaption>The KL-divergence with first term removed</figcaption></figure><p>Now, given the dataset D from the distribution P, we can approximate this expectation value with the mean, giving us the following expression.</p><figure><img alt="The logarithm of the second term of KL-divergence" src="https://cdn-images-1.medium.com/max/1024/1*IknanKZJ7z9wOgBmwU3lYw.png" /><figcaption>The logarithm of the second term of KL-divergence</figcaption></figure><p>Take the negative of this, and we are back to the negative log likelihood.</p><figure><img alt="The Cross Entropy loss function" src="https://cdn-images-1.medium.com/max/1024/1*SX3wtgnIpn5L5ZDXsXcbFA.png" /><figcaption>The Cross Entropy loss function</figcaption></figure><p>Written out in this manner, you might recognize this value as the C<strong>ross-Entropy loss</strong>. This loss function is usually used for classification tasks, as is usually seen through the eyes of the KL-divergence. But as we have seen, KL-divergence maximization is equivalent to maximum likelihood estimation through negative log likelihood.</p><h3>Conclusion</h3><p>Ceres was eventually found again after its walk behind the sun. The path Gauss found to be the most likely did, in fact, help the astronomers find where Ceres was, allowing them to continue their studies. Today, we know that Ceres is a dwarf planet, orbiting between Mars and Jupiter in the main asteroid belt.</p><p>The framework of Maximum Likelihood Estimation is not a historical artifact; it is, in fact, the foundation of much of ML, more central than many realize. The framework of empirical risk minimization tells us how to learn a model&#39;s parameters, and maximum likelihood tells us why the most common losses take the shape they do. When we minimize them, we are not just minimizing numbers — we are making explicit the beliefs we hold about noise, uncertainty, and probability itself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d4258bce317" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-collective/loss-functions-and-their-origins-5d4258bce317">Loss Functions and Their Origins</a> was originally published in <a href="https://medium.com/data-science-collective">Data Science Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Are Ensemble Methods?]]></title>
            <link>https://medium.com/data-science-collective/what-are-ensemble-methods-110e2d5a077e?source=rss-8bbf96154c94------2</link>
            <guid isPermaLink="false">https://medium.com/p/110e2d5a077e</guid>
            <category><![CDATA[ensemble-method]]></category>
            <category><![CDATA[ensemble-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Herman Jangsett Mostein]]></dc:creator>
            <pubDate>Sat, 14 Jun 2025 22:25:04 GMT</pubDate>
            <atom:updated>2026-02-10T01:19:05.013Z</atom:updated>
            <content:encoded><![CDATA[<h4>A modern view on how collaboration improves Machine Learning</h4><h3>Collaboration is key</h3><h4>Guessing games</h4><p>Let us play a game. I have a jar of jelly beans (see picture below). Can you guess how many jelly beans are in my container? Probably not, it is quite hard to guess. Now, imagine that 10,000 people join this game, and they all come up with a guess as to the number of beans in the jar. How accurate would the mean average of all their guesses be?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ao4_UU30YyfL92sg-WSPZg.png" /><figcaption>How many jelly beans are in this jar? Source: ChatGPT</figcaption></figure><p>It turns out that a collective of people is better at this guessing game than any one person is likely to be. Some people will overshoot the number of beans in the jar, while others will undershoot; however, their guesses will cancel each other out. That does not mean that the average of the answers is always better, but it will be more likely to be a good answer.</p><p>Marquis de Condorcet posed a theorem in 1785 called Condorcet’s jury theorem, relating to political science. It says that if every single person has more than 50% probability of voting correctly for any matter, then adding more voters will help the combined results up to the point of approaching 100% correct. On the other hand, if the voters have less than 50% probability, adding voters makes the results worse.</p><p>While Mr. Condorcet used this result in political science, it laid the groundwork for what would eventually become Ensemble Methods.</p><h4>Why is the mean better?</h4><p>When we combine several guesses into one by taking their mean, we are effectively reducing the variance of our guesses. This is evident in the calculations below. The variance of the mean is inversely proportional to the number of guesses in the average.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/0*KYn7wEn7GIxTE13F.png" /><figcaption>Calculations on reduced variance of averages. Source: <a href="https://medium.com/data-science-collective/multi-query-retrieval-in-rag-and-why-averaging-embeddings-works-well-1634a0c1dd15">Previous article</a></figcaption></figure><p>This is a handy trick. That means that we can improve our guess simply by repeating the experiment—no extra information needed.</p><p>What about bias? Let us imagine that the jar is a trick jar. It is hollowed out, which fools all the participants into thinking that there are more jelly beans than there are. That would create bias. And if all the participants of the guessing game are tricked, then the average will also be skewed away. Averaging decreases variance, but it cannot help the bias.</p><p>How can we use this logic in our Machine Learning models? That is where Ensemble Methods come in.</p><h3>What are Ensemble Methods</h3><p>Ensemble Methods are a family of Machine Learning (ML) methods that use predictions from multiple models to improve performance. This is a fairly intuitive concept; we see several examples of this in other parts of our lives. Every time we vote on something, redo something, or ask for help, we are relying on the wisdom of the plurality.</p><p>This family of models is vast and can encompass numerous things. The simplest way of using ensembling is to train two models on the same task and use their average prediction as the final prediction. This is technically ensembling. However, there are smarter ways of combining different models in ways that significantly improve performance. Let us see some examples.</p><h3>Examples of Ensemble Methods</h3><h4>Random Forest</h4><p>Forests consist of trees, and so do Random Forests. A Random Forest is an ensemble method that combines Decision Trees by splitting the dataset and the data features, and finally combining their predictions.</p><p>First, we split the dataset into several overlapping subdatasets. This is called bagging and is meant to introduce diversity into our prediction system. Not only do we split the datapoints, but we also split the features. This technique is known as feature bagging, which also has the purpose of introducing diversity.</p><p>Now, we can train decision trees on these fractured datasets, such that each tree learns different correlations on different subsets of the data, with varying subspaces of the feature space. During inference, we average the predictions of the trees to create a final prediction. The idea is for the models not to get stuck in local minima by focusing on certain correlations in the data, but rather to diversify and reach probable predictions through many paths.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JpdwNm40SErne0Tzt1Cxrg.png" /><figcaption>The decision boundaries of different tress in a Random Forest</figcaption></figure><h4>Gradient boosting</h4><p>Gradient boosting is a boosting algorithm that iteratively removes the error from a simple model. Let&#39;s walk through its mechanics in a simple regression task.</p><p>Start with a super simple model, e.g., just predicting the average label of each data point. Now, find the residuals (rᵢₘ), or rather the gradient of the loss function, for each data point. The residuals can be thought of as the difference between the ground truth and the prediction of the simple model, or rather, the error of our model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*enoab4R1UwKOmGHg5ca5PQ.png" /><figcaption>The residuals are the gradient of the loss function.</figcaption></figure><p>Now, what if we just remove the error from our original model? We can do this by training a model to predict the residual of the original model, and simply define a new model that is the original minus the errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*mLY8adKzoHo8Qeh3Bh3CuA.png" /><figcaption>We train each new model to predict the errors where the previous ones fail.</figcaption></figure><p>This is a straightforward idea. We simply fix the model in the places where it fails. Every model is responsible for fixing the errors of the previous one, and we end up with an ensemble that eliminates its errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*fa5nm1bFbNGpgxJKLJG_9w.png" /><figcaption>We iteratively define new models that improve the old one.</figcaption></figure><p>This process can continue iteratively. You find the errors of the current model, make a model that predicts the errors, and define a new model that removes the errors from the old one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*ROTOgdkstxlndqDVnDFe9A.gif" /><figcaption>Illustration of the decision boundary of a Gradient Boosting model during training.</figcaption></figure><h3>Advantages of Ensemble Methods</h3><p>Ensemble Methods are a large family of models, with different properties and advantages, but some common elements apply to many algorithms.</p><h4>Low variance</h4><p>As seen in the introductory chapter of this article, the mean average of many “guesses” has a lower variance than each individual guess by itself. This effect is employed in many Ensemble Methods and provides strong performance.</p><p>High variance is often associated with overfitting. This makes ensemble methods a good choice for situations where overfitting is an issue.</p><h4>Robustness</h4><p>Ensemble Methods are also known to be robust, meaning they are less sensitive to noise and outliers. As many models are combined, their individual errors will be cancelled out by the other models, making them less sensitive to single outliers that create errors.</p><p>This can be easily seen through the lens of bagging. Some models will be trained on datasets with certain outliers, but many other models might not. This gives the effect that a single outlier is overruled by the models that are not trained on that point.</p><h3>Weaknesses of Ensemble Methods</h3><p>The “No Free Lunch Theorem” tells us that no models are without flaws. Here are the flaws of Ensemble Methods.</p><h4>Slow inference</h4><p>As many models are combined, all of their inferences are needed to make predictions. This makes the Ensemble generally slower than a single model would be. This will vary with method and number of models in your ensemble, but it is a general tendency. Some models have parallelization properties, but not all of them.</p><h4>Less explainable</h4><p>By the nature of Ensemble Methods, they are less explainable than single models would be. A combination of several models is harder to understand than any of them is by themselves. This might be an issue in cases where explainability is important, for example, in finance or the health sector.</p><h3>Modern Ensemble Methods</h3><p>While Ensemble Methods are definitely in the category of “old school” ML methods, they are still highly relevant today.</p><p>The most commonly used Ensemble Method is likely XGBoost, the widely adopted open-source Python library. It is an optimized implementation of Gradient Boosting, the algorithm we discussed above. Due to its performance and high accuracy, this is a common choice for Data Scientists. The library simplifies implementation, which encourages adoption.</p><p>Ensemble Deep Learning is a common framework today, as Deep Learning is an increasingly studied subject. This subgenre creates ensembles out of Deep Learning models, utilizing their rich function space and scalable learning qualities. LLMs (Large Language Models) may also use ensemble-like methods. This might be in the classical form of an average of the inference of several models, or may take an agentic form, where different models can be selected. Often, it is hard to know exactly the architectures of some of these models, as many of them are proprietary.</p><p>One common method in LLMs is Mixture of Experts (MoE). This is not a classic Ensemble Method, but it employs ensemble learning, where different blocks in the models might be used for different types of input. This allows for the distribution of knowledge and poses some benefits. MoE is employed in many LLMs today, like Mixtral and GPT-4.</p><p>In a <a href="https://medium.com/data-science-collective/multi-query-retrieval-in-rag-and-why-averaging-embeddings-works-well-1634a0c1dd15">previous article</a>, I studied how ensemble-like inference in Retrieval Augmented Generation (RAG) provides better retrieval, improving the way people interact with their data. This is also an example of how Ensemble Methods inspires innovations beyond the classical learning algorithms.</p><h3>Conclusion</h3><p>While Ensemble Methods are old, they provide some concrete theoretical foundation for modelling that is performative and accurate. This rich family of models provides not only useful tools but also inspires modern methods that will improve ML as well as the subgenre of LLMs.</p><h4>Resources</h4><p><em>Herman Mostein — </em><a href="https://medium.com/data-science-collective/multi-query-retrieval-in-rag-and-why-averaging-embeddings-works-well-1634a0c1dd15?source=your_stories_page--------------------------------------------"><em>Multi-query retrieval in RAG and why averaging embeddings works well</em></a></p><p><em>David Eigen et al. — </em><a href="https://arxiv.org/abs/1312.4314"><em>Learning Factored Representations in a Deep Mixture of Experts</em></a></p><p><a href="https://xgboost.readthedocs.io/en/stable/"><em>XGBoost</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=110e2d5a077e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-collective/what-are-ensemble-methods-110e2d5a077e">What Are Ensemble Methods?</a> was originally published in <a href="https://medium.com/data-science-collective">Data Science Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make Better Models — Inductive Bias and Symmetries in Machine Learning]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science-collective/make-better-models-inductive-bias-and-symmetries-in-machine-learning-6ab0eafba6df?source=rss-8bbf96154c94------2"><img src="https://cdn-images-1.medium.com/max/1536/1*KVlHKZiH6aECAnc3ToWTNg.png" width="1536"></a></p><p class="medium-feed-snippet">Which assumptions do you make about your data? Inductive bias is all about exploiting what you already know to make models better. This&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/data-science-collective/make-better-models-inductive-bias-and-symmetries-in-machine-learning-6ab0eafba6df?source=rss-8bbf96154c94------2">Continue reading on Data Science Collective »</a></p></div>]]></description>
            <link>https://medium.com/data-science-collective/make-better-models-inductive-bias-and-symmetries-in-machine-learning-6ab0eafba6df?source=rss-8bbf96154c94------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ab0eafba6df</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Herman Jangsett Mostein]]></dc:creator>
            <pubDate>Mon, 26 May 2025 22:17:12 GMT</pubDate>
            <atom:updated>2025-05-26T22:17:12.540Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What is Particle Swarm Optimization?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science-collective/what-is-particle-swarm-optimization-e1c79a993983?source=rss-8bbf96154c94------2"><img src="https://cdn-images-1.medium.com/max/1536/1*LyljLGsN81x22PqRASYm0w.png" width="1536"></a></p><p class="medium-feed-snippet">How can a group of simple agents solve hard optimization problems? This article will dive into the details of the Particle Swarm&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/data-science-collective/what-is-particle-swarm-optimization-e1c79a993983?source=rss-8bbf96154c94------2">Continue reading on Data Science Collective »</a></p></div>]]></description>
            <link>https://medium.com/data-science-collective/what-is-particle-swarm-optimization-e1c79a993983?source=rss-8bbf96154c94------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1c79a993983</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[swarm-intelligence]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Herman Jangsett Mostein]]></dc:creator>
            <pubDate>Sun, 18 May 2025 02:27:45 GMT</pubDate>
            <atom:updated>2025-05-18T02:27:45.612Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Bridging Probability and Physics: How Sampling and Optimization Connect]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science-collective/bridging-probability-and-physics-how-sampling-and-optimization-connect-4934469342b7?source=rss-8bbf96154c94------2"><img src="https://cdn-images-1.medium.com/max/1536/1*ou4abXwmJdR7Up2k5nkbqQ.png" width="1536"></a></p><p class="medium-feed-snippet">Have you ever realized that Simulated Annealing is just a special case of the Metropolis algorithm? This article will explore a&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/data-science-collective/bridging-probability-and-physics-how-sampling-and-optimization-connect-4934469342b7?source=rss-8bbf96154c94------2">Continue reading on Data Science Collective »</a></p></div>]]></description>
            <link>https://medium.com/data-science-collective/bridging-probability-and-physics-how-sampling-and-optimization-connect-4934469342b7?source=rss-8bbf96154c94------2</link>
            <guid isPermaLink="false">https://medium.com/p/4934469342b7</guid>
            <category><![CDATA[markov-chains]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[sampling-distribution]]></category>
            <category><![CDATA[physics]]></category>
            <dc:creator><![CDATA[Herman Jangsett Mostein]]></dc:creator>
            <pubDate>Sat, 10 May 2025 03:08:55 GMT</pubDate>
            <atom:updated>2025-05-10T03:08:55.278Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Multi-query retrieval in RAG and why averaging embeddings works well]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/data-science-collective/multi-query-retrieval-in-rag-and-why-averaging-embeddings-works-well-1634a0c1dd15?source=rss-8bbf96154c94------2"><img src="https://cdn-images-1.medium.com/max/1024/1*vbaPeeI3IHnKy-JmIukOKw.png" width="1024"></a></p><p class="medium-feed-snippet">Everyone wants to use RAG today. It is a simple way to integrate your data into a chatbot without the need to train or fine-tune a model&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/data-science-collective/multi-query-retrieval-in-rag-and-why-averaging-embeddings-works-well-1634a0c1dd15?source=rss-8bbf96154c94------2">Continue reading on Data Science Collective »</a></p></div>]]></description>
            <link>https://medium.com/data-science-collective/multi-query-retrieval-in-rag-and-why-averaging-embeddings-works-well-1634a0c1dd15?source=rss-8bbf96154c94------2</link>
            <guid isPermaLink="false">https://medium.com/p/1634a0c1dd15</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[multiquery]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Herman Jangsett Mostein]]></dc:creator>
            <pubDate>Tue, 08 Apr 2025 14:42:45 GMT</pubDate>
            <atom:updated>2025-05-13T02:55:10.277Z</atom:updated>
        </item>
    </channel>
</rss>