Pathways to Performance
Metrics and Insights
This is part of a weekly series covering generative AI as applied to investing, drawn from source material from the full-length book, Truth Engine: Applying AI to Investing.
It wasn’t going fast enough for Jeff Dean, the manager of Google’s AI division. He wanted to accelerate AI development on his teams. Dean knew that tightly coupling development with feedback for the engineer was paramount for time to solution. He drew on his own inspirations as one of the top technical architects of Google’s search engine infrastructure. For his contributions, Google engineers had immortalized him with Jeff Dean memes that riffed on Chuck Norris jokes. One went, “the compiler (an automated code system) doesn’t warn Jeff, he warns the compiler.” Dean, who had taken leadership of Google Brain, knew that ML experiments, if unmonitored, could balloon in time, with one early ML experiment allegedly running nine months on their first generation DistBelief framework. Dean’s solution used a directed acyclic graph (DAG), a computation diagram that flowed like a river, and most importantly allowed interaction in the computation process, much like substations along a river. The DAG approach was proved out with the efficient vision network InceptionV3, which used three sampling points (loss monitors), and won second place in the 2015 ImageNet competition. Dean understood the developer, in charge of creating new paradigms, needed a flexible way of meta-learning or designing his feedback environment. We explore how learning and meta-learning is core to value investing and AI progress, especially generative AI.
In ML, so-called self-supervision enforces consistency in a common sense way. Self-consistency is prized socially, especially by millennials. Millennials abhor hypocrisy, violation of consistency in beliefs. The millennial generation has been criticized for demanding consistency. One weakness in self-consistency and perhaps the critique from older generations is that self-consistency penalizes ambiguity, any one to many mapping. Meanwhile, base translation systems use the self-supervised cycle consistency method since meaning should be preserved. Cycle consistency would translate a passage from English to French and then back to English again. In investing, we can practice self-supervision via retrospective analysis, which puts us in the shoes of professional evaluators. The emerging CAIA certificant is an analyst meant to conduct due diligence for pension funds and institutions, and their evaluations are a reasonable viewpoint. They outline a few concerns – filtering the closet indexer and the non-scaler, detected by comparing time weighted versus dollar weighted returns.
A closet indexer is an actively managed fund that claims to generate alpha (above-market returns) but in reality mirrors the performance of a benchmark index. Essentially, the fund is charging higher fees for active management while delivering performance that could be achieved with a cheaper index fund. By comparing the time-weighted and dollar-weighted returns of a fund to those of a benchmark index, one can determine how closely the fund’s performance aligns with the index. If the returns are very similar, the fund might be a closet indexer. The time-weighted return removes the effect of cash flows into and out of the fund, focusing solely on the fund’s investment performance. The dollar-weighted return, on the other hand, accounts for the timing and amount of investor cash flows, providing a measure of the actual investor experience.
A non-scaler is an investment fund or strategy that performs well with a small amount of assets but faces difficulties when trying to scale up its operations. This could be due to various factors, such as liquidity constraints or market impact costs, which become more significant as the fund grows in size. Here, the comparison between time-weighted and dollar-weighted returns could reveal a non-scaler by showing that the investment strategy does not hold up well when more capital is involved. A consistent divergence between these two types of returns could be a red flag. For instance, if the time-weighted return looks promising but the dollar-weighted return is lagging, it could indicate that the strategy doesn’t scale effectively with increasing assets. Examining order sizes versus average trading volume can prospectively identify non-scaling.
Unsurprisingly, internal metrics have far-reaching consequences in ML and management. We now discuss the strong influence ML objectives have on performance.
ML Objective Functions: Function and Purpose
Objective functions in ML are called loss functions because they focus on errors to drive corrections to the neural network. ML loss functions (figure) sit atop performance metrics in portfolio management since their aim is learning. Like Buffett planning for the long-term, NNs target improvement in a myriad of ways. In the context of linear fit, the mean squared error (MSE) pioneered by Gauss is similar to the concept of tracking error in portfolio management. Just as the tracking error measures the standard deviation of the difference between a portfolio’s returns and its benchmark’s returns, MSE calculates the average of the squares of the errors between the predicted and actual values. It’s sensitive to large errors, much like how tracking errors can be significantly impacted by large discrepancies between a portfolio and its benchmark. MSE enforces fidelity to a degree that’s too punitive for early stages in learning.
Figure: Objective functions like performance metrics reflect a function and purpose
Mean absolute error (MAE) is similar to absolute drawdown in a portfolio, which measures the absolute loss from peak to trough. MAE is less sensitive to extreme values, making it more robust when there are outliers or when the data is skewed. It focuses on the magnitude of errors without overly penalizing large errors, similar to how absolute drawdown considers the magnitude of losses but does not square them.
Huber loss can be seen as a hybrid of tracking error and absolute drawdown. It works like MSE for small errors and like MAE for large errors. Imagine a portfolio evaluation metric that uses tracking error for returns within a certain range but switches to absolute drawdown when returns diverge significantly from the benchmark. This would be more forgiving of extreme events, similar to how Huber Loss is more robust to outliers.
In classification problems, binary cross-entropy or log loss is comparable to the Sharpe ratio, which gauges risk-adjusted returns. Just as the Sharpe ratio evaluates the performance of an investment by adjusting for its risk, log loss measures the performance of a binary classification model by taking into account the predicted probabilities. It provides a more nuanced view than just counting misclassifications, making it useful for probabilistic predictions.
For multi-class classification problems, categorical cross-entropy is used. It extends the concept of Binary cross-entropy to multiple classes, much like how a multi-asset portfolio evaluation would extend the Sharpe ratio calculations to account for multiple asset classes.
Hinge loss can be related to the concept of a MoS in value investing. The loss function aims to not just correctly classify, but also maximize the margin between classes, ensuring a buffer like how we look for a high intrinsic value than price to minimize downside risk. The hinge loss, with its flat region, mimics Buffett’s propensity for inaction. In the flat region, no change is sent.
In specialized scenarios, Kullback-Leibler (KL) Divergence serves a prized role that would resonate with Buffett’s love of non-transitive dice, the didactic distributions toy.73 The KL divergence quantifies the difference between two probability distributions by calculating how much one diverges from the other. In this sense, it’s akin to a sophisticated risk assessment tool that doesn’t just look at a single metric, but evaluates the entire distribution of returns or outcomes. In investment management, imagine if you had a complex model of the expected returns of an asset, taking into account various scenarios, economic conditions, and other variables, resulting in a probability distribution of expected returns. This could compare to the actual distribution of returns based on historical data. The KL Divergence allows an integrative comparison between two distributions in a comprehensive manner.
Cosine similarity and intersection over union (IoU) are more specialized loss functions. Cosine Similarity can be likened to correlation coefficients between asset returns in a portfolio, while IoU is more like measuring the overlap between targeted and actual portfolio holdings. IoU is particularly useful in imaging applications, like segmenting tumors or identifying pedestrians.
Loss functions in ML serve as the guiding metrics for model training, much like how various performance and risk metrics guide investment decisions. Choosing the right loss function is selecting the right evaluation metric for an investment strategy, as both set the course for optimization efforts. Grove famously chided Christensen for not taking this to heart. AI engineers mix and match the concepts, and even tailor bespoke ones, much like a financial planner tailors for a client. For both roles, it’s a justified and renewable fount of industry.
This is part of a weekly series covering generative AI as applied to investing, drawn from source material from the full-length book, Truth Engine: Applying AI to Investing.