How Can AD Help Risk Management, Hedging, Save Compute Time, and Ultimately Give Trading Desks a Competitive Edge?

Published 20/07/2022 By Lenny Pitt

We look at how Automatic Differentiation (AD) can have a positive impact on Investment Banking, and more specifically Trading Desks and their operations, what those impacts are and how to make the most of them.

A Quick Intro…

At NAG, we have been working and delivering on AD solutions for many years, and we always find it useful to first explain briefly what AD is before we talk about the benefits. AD is short for Automatic Differentiation, or Algorithmic Differentiation, depending on … well let’s not get into that. It is a technology to assist in the accurate and efficient evaluation of the derivatives (i.e., sensitivities) of a mathematical function implemented as a computer program. It delivers accurate derivatives of complicated problems, faster. It can be used in many fields, but here we are going to focus on the Financial Sector, specifically, Investment Banking.

We will be covering how it can help in other fields, so subscribe or follow us to see more in the future!

How does AD help in Investment Banking?

Unsurprisingly, AD can help Investment Banks in several ways. We are going to break those down here…

Our experience tells us that desks trading in exotic derivatives, or any product affected by market fluctuations, can and do benefit from AD technology. It all comes down to the speed at which risk can be calculated. When banks are calculating risk positions for volatile products, they tend to use a ‘finite difference’ method, or ‘bumping’ as it’s otherwise known. Using ‘bumping’, risk calculations can take hours so, are often run overnight, which presents its own problems. This is fundamentally where AD has the most impact. AD is essentially a library of advanced algorithms that allow the sensitivities or Greeks of a product to be calculated anything from 10x to 6000x faster. (NB: these results are based on the use of NAG’s AD product dco/c++).

How does it do this? Put relatively simply, this speed-up is achieved by exploiting adjoint AD, which conceptually runs your program in reverse to avoid the linear growth in complexity observed when ‘bumping’. In addition, AD uses the chain rule with exact derivatives of all intrinsic operations. This can have a huge and positive impact across the whole desk.

It all starts with the person who will be most hands-on with AD, the quant, or whoever is building and maintaining pricing and risk libraries. The first step is to implement AD into those libraries, which often can be done more quickly than people think. Once this is done, AD technology gives the quant extensive capabilities to optimise the speed of all risk calculations and compute them with machine precision. As a side note, this can propel the quant to rock star status in the bank!

At the other end of the process are the traders. With faster (intra-day), richer (i.e., often containing more risks than they can compute via bumping) risk coming because of AD, the traders can do their job more confidently and more effectively. The speed means the risk doesn’t necessarily need to be calculated overnight. This speed-up gives traders the option to run risk multiple times a day giving them more information and allowing them to make more decisions.

Overall, AD can solve quite a few problems including: risk calculations taking too long, not all Greeks being computed, and even concerns around the accuracy of the data. If a bank is suffering from these issues, it means trading desks cannot make advantageous decisions quickly! As Net Zero comes ever more into focus, another important benefit is the saving that AD can deliver on compute time. This could soon become integral to a bank’s operations.

With AD, trading desks can hedge auspiciously and gain a competitive edge in the market as the mathematical algorithm technology can provide them with rich, cheap and accurate intra-day risk. This means more profits for traders and for the business.

Sounds good. Let’s dig deeper.

AD is a mixture of very advanced computer science technologies and mathematics, and investment banks are busy places with long working hours and (potentially) high levels of stress. This could be entirely why AD would be a great move for a bank. Once AD is implemented, it can help banks work smarter and lower spend. With FRTB coming in, banks will be required to do even more risk calculations. AD could be an opportunity to comply with FRTB before it gets unmanageable.

If you are considering AD, we recommend a Proof of Concept (PoC). Its purpose should be solely to help the trading desk understand the benefits it will get from AD whilst making the whole process as easy as possible. The main reason for this is it will help with buy-in across the board as the results usually speak for themselves. It also helps to make sure the project doesn’t stall, which can happen in banks.

We would suggest starting by building AD into a section of the trading desks libraries, using best practice, to evaluate and ‘prove’ the impact of the technology on operations. A standard PoC would be broken into 3 parts: training, planning and implementation. During implementation, we strongly recommend the quants/gatekeepers of the libraries at the banks work with experts to establish success metrics, and give support on design, testing, debugging, performance tuning, and anything else that might crop up. All this will help the quants get to grips with AD technology (if they aren’t already).

Overall, a PoC is a low-cost, low-risk way of making a thorough but quick assessment of the impact AD will have on the trading desk and its libraries using real-world result metrics without the outlay of resources, time and money.

The next step (if the PoC shows the bank what they were looking for!) is full integration of AD to the trading desks libraries. Unless the Bank has staff already proficient in the ways of AD, we would always suggest that a trading desk enlists the help of an expert to ensure that the integration of AD does not hinder other projects or day-to-day operations and that the bank maintains full ownership and control over its libraries.

A good integration service means not only that the value of AD is maximised, but that it is achieved as fast as possible by removing the learning curve of AD. It will also help deliver best practices and it means the trading desk will have expert advice to hand when making key decisions.

Last but not least

Once everything is up and running (or even before, if the bank has chosen to do implementation itself), the support of an AD expert will always prove beneficial. We recommend that the bank has agreed support on API, features, bug fixes and general advice to a level that will allow the bank to get the best from AD. This will help to ensure there are no unnecessary delays to projects or development work and give the trading desk maximum confidence in its operation. In our experience, the knowledge that you will never be left alone to manage the product, and that there will always be someone ready to help you, can be invaluable.

And that’s it!

From start to finish, that’s how an investment bank, and more specifically, a trading desk can benefit from AD. AD can be misunderstood, and our mission is to help everyone understand how it works, and what value it can bring!