Tuesday, April 18, 2023

Will ChatGPT disrupt the retirement planning space ?

When a pal heard that I'm developing an investment course focused on exploring finance through Python code, he expressed scepticism because he knows a trader who uses ChapGPT to craft basic code to make investment decisions. I did not bother to refute this argument because even with the best code, you still need to make the best trades, and programmers don't make the best investors.

I was unable to verify the argument yesterday until someone on the forums tried to use some keywords to generate some Python code on ChatGPT. His claim is that the code is able to simulate Monte Carlo portfolios and give a percentage of the number of portfolios that make it under an assumed withdrawal rate.

Perhaps this was a great moment for learning for me, I took the code for a test drive and it was horrible.

  • First of all, the cut-and-paste process in Facebook lacked indentation, so I had trouble with the different loops in the program. Nested loops can become consecutive loops if the Python indentment was lost. I lost maybe 15 minutes sorting that out.
  • ChaptGPT programs also produced stub files like a CSV file containing historical returns without really telling you how to find them. The contents of these stub files are very consequential in retirement planning, but ChatGPT does not supply them. I had to inject my own code to download data from Yahoo Finance in real time and generate annual statistics to resolve that issue.
  • The next problem was logic errors in the code even after correcting syntax issues. The code would grow the portfolio using, say, 10 years of returns every year. So every retirement portfolio works in 10,000 different alternate universes because they could be getting 90% returns annually. Worse, the code sees an annual withdrawal rate as a percentage of evolving portfolio value and not as a fixed expense moderated by an inflation rate. Theses are fatal flaws.
  • Finally, after troubleshooting everything, the code would still provide an uneasy number to bring confidence to any investor. I had to add an inflation generator to bring the success probabilities down. 

Ok, now let's look at the positives. ChatGPT wrote a fairly bad program, but it can be corrected to work with better prompt engineering, and about 2-3 man-hours and I'm not even a professional software developer. This can be a huge productivity multiplier for many software engineers. 

But, as it stands,  I don't think someone without a basic understanding of the domain in both finance and IT can petition ChatGPT to come up with something that they can run to make fairly important investment decisions and there should be revenue in my upcoming course.

For now, the software engineering types will have serious concerns about how ChatGPT will change their working landscape. Eventually, some untrained manager with a general degree will pretend that he can issue a prompt to ChatGPT and then he will dump the entire source code to you, claiming that a huge bulk of the work is already done on your behalf. All you need to do is to 'operate' it. 

This is going to be a real problem in the workplace because many MBAs are poets.

Getting to run is already a chore. Troubleshooting the business logic will take more time. Enhancement to make it viable as a product will take even longer. 

This nifty Monte Carlo tool will be refined and given to folks in my ERM Community. Hope this can provide them with a new tool to test the effectiveness of their retirement portfolio.


Using 10 years of data, a 60/40 portfolio has a 34.2% surviving 40 years based on the 4% withdrawal rule.









1 comment:

  1. ChatGPT is an advanced language model that allows users to interact and have conversations with an AI-powered virtual assistant. However, like any online service, users may encounter login errors that can hinder their experience. In this article, we will discuss five common ChatGPT login errors and provide troubleshooting steps to help you overcome them.

    ReplyDelete