Side-Popup-Image
Become a Quant Trader Apply Now
Quant Jobs This Article

Book Introduction: Generative AI for Trading & Asset Management

Written by:  Dr Hamlet Jesse Medina Ruiz and Dr Ernest P Chan
Book Authors: Dr Hamlet Jesse Medina Ruiz and Dr Ernest P Chan

Both Dr Chan and Dr Medina have been long-standing collaborators and faculty members at QuantInsti, contributing their expertise across our advanced machine learning and quantitative strategy curriculum.

Dr Ernest P. Chan is a leading expert in quantitative trading with decades of experience and several influential books to his name. Dr Hamlet Jesse Medina Ruiz is an applied AI expert with over a decade of experience, specialising in deep generative models, Large Language Models post-training techniques, and time series modelling. His work focuses on making advanced AI techniques practical for financial applications.


Introduction

The world of finance is no stranger to artificial intelligence. Most quantitative asset managers are already familiar with discriminative models, for example, given yesterday’s return, what is the probability that today’s return will be positive? Many are also familiar with reinforcement learning, used for tasks like optimising order execution or figuring out how to set the best capital allocations within a portfolio to get a better Sharpe ratio.

But now there’s a new wave of AI, Generative AI, or GenAI for short, that’s making headlines and even filling up your social media feeds.

In the news, GenAI is usually associated with large language models (LLMs) like ChatGPT, or with image generation tools like MidJourney, essentially, machines that can learn from text or images and generate text or images. But in reality, these models can learn from many different types of data. In particular, they can learn from time series of asset returns, which is perhaps the most relevant for asset managers.

In our book (Check out Generative AI for Trading and Asset Management 1st Edition on Amazon), we explore both the practical applications and the fundamental principles of GenAI, with a special focus on how these technologies apply to trading and asset management.


A Book For Practitioners and Researchers

Generative AI for Trading & Asset Management
A book for practitioners and researchers

The book is divided into two broad parts:

Part 1, written by Ernie, starts with no-code applications of GenAI for traders and asset managers with little or no coding experience. After that, it takes readers on a whirlwind tour of machine learning techniques commonly used in finance.

Part 2, written by Hamlet, covers the fundamentals and technical details of GenAI, from modelling to efficient inference. This part is for those who want to understand the inner workings of these models and how to adapt them to their own custom data and applications. It’s for anyone who wants to go beyond the high-level use cases, get their hands dirty, and apply, and eventually improve these models in real-world practical applications.

Readers can start with whichever part they want to explore and learn from.


Part 1: No-Code GenAI for Traders and Asset Managers

In the first two chapters of Part 1, we show practical, hands-on examples of how GenAI can assist traders and asset managers with tasks they deal with all the time. Things like:

  • Retrieving adjusted price data from public sources
  • Computing basic performance metrics
  • Converting trading strategy code from one language to another, for example, from Matlab to Python (we use examples from Ernie’s Machine Trading book)
  • Generating Python code based on plain-language descriptions of a strategy
  • Summarising research papers and turning the key ideas into code

What we will not show you is this:

“ChatGPT, give me a strategy that will make me millions so I can deploy it right now and quit my day job.”

At this stage, GenAI does not provide reliable fully automated alpha generation. Still, GenAI can assist with the strategy development process. We demonstrate examples where GenAI helped draft and understand:

  • A long-short factor strategy
  • A VIX futures carry strategy
  • A SPX options calendar spread
  • Literature searches on portfolio optimisation using deep reinforcement learning

All these tasks were done using familiar tools like ChatGPT GPT-4o and Microsoft’s Copilot. Please, keep in mind that these models are evolving quickly. We tested these examples in early 2024. If you are curious how newer versions of LLMs perform on the same tasks, Ernie did a follow-up in April 2025. You can check it out on our Substack:

https://gatambook.substack.com/p/have-llms-improved-over-the-last

This part of the book is designed to be accessible, so no need for advanced prompt engineering or advanced development workflows. But for those with more experience, we encourage experimenting with these same examples using  Agentic workflows,  with tools like Cursor, Codex, Deep Research, and others, where capabilities are evolving really fast.


A Quick Tour of AI for Asset Managers

Before diving deeper into Generative AI, we included a short but essential tour of machine learning techniques commonly used in finance, with topics like:

  • Supervised learning.
  • Unsupervised learning,
  • Reinforcement learning. For a recent post on reinforcement learning for portfolio optimisation, check this: https://gatambook.substack.com/p/deep-reinforcement-learning-for-portfolio
  • Techniques to avoid overfitting and improve model selection
  • Practical aspects of data engineering, which are often just as important as the model itself.

If you are new to AI, this chapter provides the fundamentals. If you’re already familiar with machine learning, think of it as a refresher. It will help you to set the stage for understanding where GenAI fits into the bigger picture.


Part 2: Technical Foundations, Advanced Models, Real-World Deployment

Part 2 of the book dives into the fundamentals and technical details of GenAI, covering topics like:

  • How to generate time series synthetic data, along with different methods to evaluate the quality of the generated data
  • Forecasting applications
  • Alternative data processing
  • Sentiment analysis with LLMs
  • Techniques for efficient inference, including Parameter Efficient Fine-Tuning (PEFT), Knowledge distillation and Quantisation.

We also cover several other important topics, including the famous scaling laws used to improve the performance of these models, the emerging abilities of LLMs, and how to scale these models for production environments, among many others.


Foundations and Generative Model Families

We start with Chapter 4, which provides an introduction to GenAI and highlights the key differences between discriminative and generative models.

Chapter 4 also touches on an important topic that rarely gets enough attention,  how combining the power of discriminative and generative models can help better handle uncertainty in predictions, a topic especially relevant in finance. To get just a feeling about this, feel free to check out our video presentation here: GenAI & Automated Trading Summit | Algorithmic Trading on MT5 & TradingView

Another key point we explore is that generative models are not just about generating text or images. They are also powerful tools for representation learning, which is key for techniques like Retrieval Augmented Generation (RAG). If you’ve been following recent AI developments, you know RAG is everywhere, helping enrich the context of your input query making LLMs produce answers that are better grounded in external data.

Each of the major generative model families gets its own dedicated chapter:

  • Deep autoregressive models, with the famous Transformer as the main example
  • Variational Autoencoders (VAEs)
  • Flow models
  • Generative Adversarial Networks (GANs)

We explain how these models were originally developed and, more importantly,  how to adapt them to the unique dynamics of financial time series, with practical, hands-on notebook examples using real financial data. For those who want more examples of how to use transformers in finance, they can visit our blog posts: https://gatambook.substack.com/p/a-poor-persons-transformer, https://gatambook.substack.com/p/applying-transformers-to-financial, and https://gatambook.substack.com/p/cross-attention-for-cross-asset-applications


Practical Applications, Efficient Inference, and Beyond

The final chapters focus on building end-to-end applications. For example, we demonstrate how to create a system that takes speech data as input and outputs trading signals. This system leverages powerful models, such as:

  • Transformers for sequence-to-sequence tasks, converting audio signals to text
  • LLMs for sentiment analysis, assigning sentiment scores to financial news or speeches

We apply these techniques to analyse the sentiment of Federal Reserve (Fed) press conference speeches, generating trading signals based on that sentiment. Below you can see the general pipeline of this system:

General pipeline
Steps for signal generation

In this chapter, you will see how to:

  • Preprocess alternative data
  • Generate trading signals
  • Use LLMs for sentiment analysis in trading

If you want a preview of this before diving into the book, check out our video presentation:  Trading Using LLM | Generative AI & Sentiment Analysis for Finance | Webinar.

We conclude Part 2 with the efficient inference topic. When it comes to real-world settings, you quickly run into practical constraints like cost and scalability for deploying these models, especially if you want to apply them for high-frequency trading. We show techniques and optimisations to help you improve the inference speed of these models.


Tools, Reproducibility, and Practical Focus

The book comes with code snippets, colour-highlighted for easy reading, so you can see how to move from theory to working code. We’ve also included a full code repository of examples for each chapter, focusing as much as possible on reproducibility. Most of the examples have been carefully chosen not just for practicality, but also based on how well they convey key ideas, and their influence in the field (often measured by the number of citations). So, you might find code examples ranging from synthetic data generation, to forecasting with transformer models, or even building your own custom Finance LLM to answer finance-related questions by fine-tuning LLaMA 3.1 8B using QLoRA, among others.

We’ve tried to use tools and frameworks that are common in both industry and some well-known AI labs. That way, for example, if you want to experiment with building your own foundational models for time series, you can start from a familiar framework that allows you to easily benchmark your work with common datasets and metrics used in research papers in the field, and, just as importantly, test your ideas directly on financial data.

To the best of our knowledge, this was the first book, at the time of writing, to cover such a broad range of topics in the field of finance. We conclude the book by summarising the main techniques discussed and emphasising the critical role of domain expertise in designing meaningful trading strategies, particularly when using LLMs as copilots. We also discuss why GenAI, despite its success in other domains, may still require more empirical work to achieve similar results in finance. Finally, we highlight some promising research directions where GenAI could significantly impact the future of finance.


Next Steps

To follow our updates, here’s where we are:

Book Substack: gatambook.substack.com

Ernie’s X (Twitter) and Substack: x.com/echanQT, substack.com/@erniechan

Hamlet’s X (Twitter) and Substack: x.com/hamletjmedina, substack.com/@hamletmedina

Upcoming Webinar |  Algorithmic Trading Conference 2025

How AI Is Reshaping Trading Today
Explore AI’s impact on trading and what the future holds. Part of QuantInsti’s 15th anniversary, marking our journey in delivering world-class education and technology. The QuantInsti Algorithmic Trading Conference brings together some of the most influential voices leading this change.

 Algorithmic Trading Conference 2025
Algorithmic Trading Conference 2025

Hear directly from:
Tucker Balch, Professor at Emory University and former Managing Director at J.P. Morgan, where he led the AI Research group
Peter Cotton, Co-Founder of Crunch Lab and creator of Microprediction, with leadership experience at JPMorgan, Intech, and ExodusPoint
Faisal Khan, Managing Director at Dynamiq Research, bringing deep expertise in systematic execution from a fund management perspective
Matteo Campellone, Executive Chairman at Brain Algorithms and a thought leader in AI-powered investment strategies
Dr. Robert Kissell, President of Kissell Research Group and a globally recognized expert in trading cost analytics and market microstructure

From cutting-edge AI models to practical quant systems used in live markets, this event is designed for traders, researchers, and technologists who want to stay ahead.

Date: Tuesday, 23 September 2025
Time: 6:00 PM IST | 8:30 PM SGT | 8:30 AM EDT

Visit quantinsti.com/algorithmic-trading-conference to explore the full agenda and register.

Build on the Concepts from Generative AI for Trading and Asset Management

Move from understanding to application with these curated learning resources aligned with the book’s core ideas.

Courses by Dr Ernest P Chan on Quantra:

Courses by Dr Hamlet Medina and Dr Ernest P Chan on Quantra:

  • LLM Trading Strategies
    Apply large language models for signal generation, code generation, and contextual understanding in trading workflows.

Dr Ernest P Chan’s guidance and impact in EPAT
Dr Ernest Chan has been a core faculty member and mentor in EPAT, contributing to both content and structure. His lecture covers momentum strategies using MATLAB, explaining concepts like roll returns, time-series vs. cross-sectional momentum, and real-world applications in futures and equities. He also contrasts momentum with mean reversion, highlighting practical differences in execution, risk, and exit methods.

Explore EPAT
Download the full EPAT Programme Brochure for details on the curriculum, faculty, and career outcomes.


Contribute and Collaborate

At QuantInsti, we believe the future of algorithmic trading depends on shared learning and open collaboration. Our mission is to make advanced tools and research in quantitative finance accessible to all, helping both individuals and institutions navigate complex markets with confidence.

If the ideas explored in this blog speak to you, we invite you to contribute to the global community of quants. Whether you are building strategies, developing tools, conducting research, or applying AI in new ways, your work can add real value.

To get started, read our Blog Contribution Guidelines. Every contribution helps grow the shared knowledge base and supports the evolution of quantitative trading. Let’s build the future together.


Connect with an EPAT career counsellor to discuss the right quant role for your background.

Disclaimer: This blog post is for informational and educational purposes only. It does not constitute financial advice or a recommendation to trade any specific assets or employ any specific strategy. All trading and investment activities involve significant risk. Always conduct your own thorough research, evaluate your personal risk tolerance, and consider seeking advice from a qualified financial professional before making any investment decisions.