Algorithms are step-by-step procedures that solve specific problems. They are the building blocks of software applications. The field of algorithms is about finding the most efficient and correct method to finish a task. Engineers need to know what algorithms exist and when to apply them. While reading More Money Than God by Sebastian Mallaby, I recognized that many roles within alternative investment funds (AIFs) and other asset management organizations benefit from creating, analyzing, and improving algorithms. This post explores how occupations within AIFs use algorithms.
🌸👋🏻 Enjoying this post? Get the next issue of [ret]2read. Once a month, I’ll email you whatever’s on my mind, usually Apple security research, offensive security, open source software freedom, and operating system internals.
Alternative investment funds
While AIFs are just one type of company, they have many roles focused on algorithms. Thus, AIFs are a great bridge to discuss why algorithms matter.
Roles
Typical roles within AIFs and how they interact with algorithms:
- Quantitative analysts (quants)
- Have strong mathematical and statistical backgrounds. They develop mathematical models and algorithms for pricing financial instruments, managing risk, and optimizing trading strategies.
- Algorithmic traders
- Design and implement algorithms for automated trading. They work closely with quants to turn mathematical models into executable code to make trading decisions based on predefined criteria.
- Software engineers
- Develop and maintain the software infrastructure that supports algorithmic trading systems. They write the code that executes algorithms, keeps the system reliable, and integrates with market data feeds and execution platforms.
- Data scientists
- Analyze large datasets to extract insights that can inform trading strategies. They may use machine learning techniques to identify patterns, correlations, and trends in financial data.
- Risk managers
- Assess and mitigate the risks of algorithmic trading, such as market, credit, and operational risks. They work closely with quants and traders to keep trading strategies within the fund’s risk tolerance.
- Infrastructure engineers
- Design and maintain the hardware and network systems that support algorithmic trading operations. They provide low-latency connectivity to markets and high-performance computing.
- Machine learning engineers
- Develop and implement algorithms to learn from data and adapt trading strategies over time.
- Quantitative developers
- Bridge the gap between quantitative research and software implementation. They translate mathematical models into code and optimize algorithms for efficient execution.
- Financial engineers
- Specialize in creating complex financial products and instruments. They work on developing derivative products and other financial instruments that can be incorporated into algorithmic trading strategies.
Common types of algorithms
Below, I listed some common types of algorithms and their respective potential usage within an AIF. I do not work at an AIF, so I have made some assumptions based on what I learned from Mallaby’s book.
1. Searching
- Linear search – scans each item in a list until the target is found.
- A linear search might be used when searching for a specific financial instrument or asset in a portfolio. The algorithm scans each item in hopes of finding the target. Here, the items and target are assets.
- Binary search – assumes the list is sorted and efficiently narrows down the search space.
- A binary search could efficiently narrow the search space if the assets are sorted based on specific criteria (e.g., market cap, risk level). Binary searches are useful for large datasets.
2. Sorting
- Bubble sort – compares adjacent elements and swaps them if they are in the wrong order.
- Bubble sort might be applied when arranging a small list of financial assets based on simple criteria, such as alphabetical order or a basic risk ranking. However, due to its inefficiency for large datasets, it is not commonly used in AIFs for sorting long lists of assets.
- Merge sort – divides the list into smaller segments, sorts them, and then merges them back together.
- When sorting a large portfolio of diverse assets based on multiple criteria (e.g., industry sector, geographical location, risk level), merge sort could help. It breaks the task into smaller parts, sorts them, and then merges them back together efficiently.
3. Graph
- Depth-First Search (DFS) – explores as far as possible along each branch before backtracking.
- In analyzing the relationships between financial instruments in a portfolio, DFS might be used to explore the dependencies and connections between assets. For example, understanding how changes in one asset might impact others in the portfolio.
- Breadth-First Search (BFS) – explores all the neighbors of a node before moving on to the next level.
- When assessing the overall risk or performance of a portfolio, BFS can be applied to explore the relationships between assets at different levels. It shows the broader impact and interactions among different segments of the portfolio.
Learn more: Graph Algorithm Basics, BFS, and DFS.
If the link isn’t active, the post hasn’t been released yet! Don’t miss out—subscribe now to receive access to future content and exclusive posts!
Field of algorithms
Remember, the field of algorithms is about finding the most efficient and correct method to finish the task. Engineers need to know what algorithms exist and when to apply them.
As a security engineer, most of my algorithm development knowledge is concerned with optimizing network latency and improving predictivity in machine learning models. Luckily, there are jobs for people specializing in network latency and machine learning. Below are the core problems these jobs address.
🌸👋🏻 Enjoying this post? Get the next issue of [ret]2read. Once a month, I’ll email you whatever’s on my mind, usually Apple security research, offensive security, open source software freedom, and operating system internals.
Network latency
Algorithms help optimize network latency by minimizing delays in data transmission. Network optimization engineers specialize in lessening these delays.
Routing algorithms find the best path for data between source and destination based on network congestion and latency metrics. Congestion control algorithms regulate data flow to prevent bottlenecks that increase latency.
Quality of service algorithms prioritize time-sensitive traffic, such as video or voice. Predictive algorithms may anticipate network conditions and adjust settings before latency becomes a problem.
In AIFs, algorithms often optimize network latency in high-frequency trading (HFT).
HFT is a type of algorithmic trading. HFT uses algorithms and powerful computers to execute a large number of financial transactions within fractions of a second, capitalizing on small price discrepancies in the market.
These algorithms execute financial transactions with minimal delay to capitalize on market inefficiencies. They use predictive models and statistical analysis to forecast market movements and place trades. They also minimize communication delays with networking techniques such as co-location (physically situating trading servers near exchange servers) and smart order routing (automatically sending orders to the trading venues with the best execution prices and lowest transaction costs).
By continuously adapting their strategies to real-time market data, these algorithms reduce the time it takes to execute trades. This gives AIFs a competitive edge in rapidly changing financial markets.
Machine learning
Outside of networking, algorithms optimize machine learning by refining models and improving their predictions. Machine learning engineers develop and implement algorithms to learn from data and adapt trading strategies over time.

Want your company or product in front of [ret]2read readers?
One sponsor per issue →
Stochastic gradient descent
In the training phase, optimization algorithms—such as stochastic gradient descent or its variants—iteratively adjust model parameters to minimize the difference between predicted and actual outcomes.
If you are curious about how stochastic gradient descent works, continue reading. If you want to skip that information, please continue to the next section.
Stochastic gradient descent is an iterative optimization algorithm that minimizes the cost function by updating model parameters—such as weights or coefficients—based on a randomly selected subset of training data in each iteration.
Cost function
The cost function represents the difference between the predicted values and the actual target values aiming to be minimized during the training process.
Weights
“Weights” refers to the model parameters adjusted during training to minimize the cost function. These weights are the coefficients assigned to a model’s features (input variables or characteristics used to make predictions or classifications).
For example, in a linear regression model, weights might be assigned to each feature. These weights are adjusted during training to make predictions that minimize the difference between the predicted and actual outcomes.
In case you were wondering, the same idea applies to neural networks, where “weights” are the parameters that determine the strength of the connections between neurons in different network layers. Stochastic gradient descent updates these weights to reduce the error in the model’s predictions.
Iteration
An iteration refers to a single cycle where the model parameters are updated based on the gradients computed from a randomly chosen subset of the training data.
🌸👋🏻 Enjoying this post? Get the next issue of [ret]2read. Once a month, I’ll email you whatever’s on my mind, usually Apple security research, offensive security, open source software freedom, and operating system internals.
Gradient
The gradient is a vector representing the partial derivatives of the cost function with respect to each model parameter, indicating the direction and magnitude of the steepest ascent.
Partial derivatives
The partial derivatives of the cost function quantify the rate of change of the cost function concerning individual parameters, guiding the optimization algorithm like stochastic gradient descent towards minimizing the overall error.
Feature selection and extraction
Now, back to how algorithms optimize machine learning models. Algorithms for feature selection and extraction identify the most relevant data attributes, improving model efficiency and reducing dimensionality (the number of features or variables in a dataset).
Hyperparameter tuning
Hyperparameter tuning algorithms select optimal configuration settings to improve model performance. Beyond training, ensemble methods boost predictive accuracy.
Algorithms also monitor models and update them as data patterns change. Overall, algorithms refine models, automate parameter adjustments, and make predictive systems more efficient.
Algorithms in AIFs
Continuing the AIF example, algorithms are integral to machine learning for financial analysis and decision-making. They process vast amounts of market data and identify patterns, correlations, and anomalies that human analysts might overlook. Quantitative trading models use machine learning algorithms to predict market trends, assess risks, and execute trades automatically.
Algorithmic strategies often involve statistical models and predictive analytics that incorporate price movements, trading volumes, and economic indicators. Reinforcement learning algorithms can adapt trading strategies based on market feedback over time.
The overall goal for AIFs with machine learning is to gain a competitive edge, make informed investment decisions, and manage portfolios.
Conclusion
AIFs are just one type of company, but they have many roles focused on algorithms, which makes them a great bridge to discuss why algorithms matter.
Understanding algorithms involves knowing their structure and evaluating their correctness and efficiency. There is no one-size-fits-all solution, so choosing the right algorithm depends on the problem. Most of the time, the key is balancing correctness and speed.
If you enjoyed this blog post on algorithms, consider reading The Importance of Key Rotation.


You must be logged in to post a comment.