PCPaulo André Lima de Castro

Paulo André Lima de Castro

*This is an algorithmically generated author record based on publicly available information.

Current Organizations / Institutes

The organizations/institutes from the scholar's latest article


Paulo André Lima de Castro has a total of 20 co-authors. Here are the top co-authors by number of shared publications:


Latest Publications

  • Sonora: An Autonomous Analyst for Anti-Money Laundering Based on Explainable Artificial Intelligence

    by Vlademir Lenin Donato Batista, Paulo André Lima de Castro

    This paper presents the development and evaluation of Sonora, an autonomous analyst based on explainable artificial intelligence (XAI) designed to support Anti-Money Laundering (AML) monitoring in financial institutions. Using real-world, imbalanced data from a Brazilian financial institution, we developed a predictive model to identify suspicious cases. A multi-stage evaluation process began with the selection of Gradient Boosting as a robust baseline model over other standard classifiers. This model was then benchmarked against an alternative model, XGBoost, selected from a pool of state-of-the-art boosting algorithms. After hyperparameter optimization for both finalists, a threshold-based analysis confirmed that Gradient Boosting delivered the best performance for a recall-focused strategy, achieving a recall of approximately 96%. We deliberately focus on recall rather than accuracy to minimize regulatory risk and ensure that critical cases are surfaced for human review. To foster institutional trust, Sonora integrates instance-level SHAP explanations, highlighting the most influential features in each classification, and it acts as a decision-support tool, not a replacement for human analysts.

  • Improving Portfolio Optimization Results with Bandit Networks

    by Gustavo de Freitas Fonseca, Lucas Coelho e Silva, Paulo André Lima de Castro


  • Open Access

    AlphaX: An AI-Based Value Investing Strategy for the Brazilian Stock Market

    by Paulo André Lima de Castro

    Autonomous trading strategies have been a subject of research within the field of artificial intelligence (AI) for aconsiderable period. Various AI techniques have been explored to develop autonomous agents capable of trading financial assets. These approaches encompass traditional methods such as neural networks, fuzzy logic, and reinforcement learning, as well as more recent advancements, including deep neural networks and deep reinforcement learning. Many developers report success in creating strategies that exhibit strong performance during simulations using historical price data, a process commonly referred to as backtesting. However, when these strategies are deployed in real markets, their performance often deteriorates, particularly in terms of risk-adjusted returns. In this study, we propose an AI-based strategy inspired by a classical investment paradigm: Value Investing. Financial AI models are highly susceptible to lookahead bias and other forms of bias that can significantly inflate performance in backtesting compared to live trading conditions. To address this issue, we conducted a series of computational simulations while controlling for these biases, thereby reducing the risk of overfitting. Our results indicate that the proposed approach outperforms major Brazilian market benchmarks. Moreover, the strategy, named AlphaX, demonstrated superior performance relative to widely used technical indicators such as the Relative Strength Index (RSI) and Money Flow Index (MFI), with statistically significant results. Finally, we discuss several open challenges and highlight emerging technologies in qualitative analysis that may contribute to the development of a comprehensive AI-based Value Investing framework in the future

  • Open Access

    Machines that halt resolve the undecidability of artificial intelligence alignment

    by Gabriel A. Melo, Marcos R. O. A. Máximo, Nei Y. Soma, Paulo A. L. Castro

    The inner alignment problem, which asserts whether an arbitrary artificial intelligence (AI) model satisfices a non-trivial alignment function of its outputs given its inputs, is undecidable. This is rigorously proved by Rice’s theorem, which is also equivalent to a reduction to Turing’s Halting Problem, whose proof sketch is presented in this work. Nevertheless, there is an enumerable set of provenly aligned AIs that are constructed from a finite set of provenly aligned operations. Therefore, we argue that the alignment should be a guaranteed property from the AI architecture rather than a characteristic imposed post-hoc on an arbitrary AI model. Furthermore, while the outer alignment problem is the definition of a judge function that captures human values and preferences, we propose that such a function must also impose a halting constraint that guarantees that the AI model always reaches a terminal state in finite execution steps. Our work presents examples and models that illustrate this constraint and the intricate challenges involved, advancing a compelling case for adopting an intrinsically hard-aligned approach to AI systems architectures that ensures halting.


  • Driving Planner for Freight Trains Using Reinforcement Learning

    by Gabriel Jose Costa Barros, Paulo Andre Lima de Castro

  • Open Access

    Transformers and attention-based networks in quantitative trading: a comprehensive survey

    by Lucas Coelho e Silva, Gustavo de Freitas Fonseca, Paulo Andre L. Castro

    Since the advent of the transformer neural network architecture, there has been a rapid adoption and investigation of its applicability in various domains, such as computer vision, speech processing, and natural language processing, with the latter most notably exemplified by the rise of Large Language Models. These accomplishments have also led to increased interest in other network architectures that rely on attention mechanisms, one of the building blocks of transformers. Transformers and other attention-based networks are being applied to the quantitative analysis, management, and trading of financial assets, be it for price movement prediction, discovery of trading strategies, portfolio optimization, and risk management. The applications range across different asset categories, including equity markets, foreign exchange pairs, cryptocurrencies, and futures markets. This survey aims to provide a comprehensive overview of the applications of attention-based networks within the field of quantitative analysis, management, and trading of financial assets. After a brief overview of transformers and attention mechanisms, we analyze the existing applications of these architectures for quantitative finance in a taxonomy of four specializations: Alpha Seeking, Risk Management, Portfolio Construction, and Execution. After comparing the literature in light of the research problems, modeling approaches, and complementary results, we discuss current challenges and research opportunities.


  • Open Access

    Improving Portfolio Optimization Results with Bandit Networks

    by Gustavo de Freitas Fonseca, Lucas Coelho e Silva, Paulo André Lima de Castro

    In Reinforcement Learning (RL), multi-armed Bandit (MAB) problems have found applications across diverse domains such as recommender systems, healthcare, and finance. Traditional MAB algorithms typically assume stationary reward distributions, which limits their effectiveness in real-world scenarios characterized by non-stationary dynamics. This paper addresses this limitation by introducing and evaluating novel Bandit algorithms designed for non-stationary environments. First, we present the Adaptive Discounted Thompson Sampling (ADTS) algorithm, which enhances adaptability through relaxed discounting and sliding window mechanisms to better respond to changes in reward distributions. We then extend this approach to the Portfolio Optimization problem by introducing the Combinatorial Adaptive Discounted Thompson Sampling (CADTS) algorithm, which addresses computational challenges within Combinatorial Bandits and improves dynamic asset allocation. Additionally, we propose a novel architecture called Bandit Networks, which integrates the outputs of ADTS and CADTS, thereby mitigating computational limitations in stock selection. Through extensive experiments using real financial market data, we demonstrate the potential of these algorithms and architectures in adapting to dynamic environments and optimizing decision-making processes. For instance, the proposed bandit network instances present superior performance when compared to classic portfolio optimization approaches, such as capital asset pricing model, equal weights, risk parity, and Markovitz, with the best network presenting an out-of-sample Sharpe Ratio 20% higher than the best performing classical model.

  • Open Access

    A Methodology for Questionnaire Analysis: Insights through Cluster Analysis of an Investor Competition Data

    by Carlos Henrique Q. Forster, Paulo André Lima de Castro, Andrei Ramalho

    In this paper, we propose a methodology for the analysis of questionnaire data along with its application on discovering insights from investor data motivated by a day trading competition. The questionnaire includes categorical questions, which are reduced to binary questions, 'yes' or 'no'. The methodology reduces dimensionality by grouping questions and participants with similar responses using clustering analysis. Rule discovery was performed by using a conversion rate metric. Innovative visual representations were proposed to validate the cluster analysis and the relation discovery between questions. When crossing with financial data, additional insights were revealed related to the recognized clusters.

  • Open Access

    N-BEATS Perceiver: A Novel Approach for Robust Cryptocurrency Portfolio Forecasting

    by Attilio Sbrana, Paulo André Lima de Castro

    Cryptocurrencies are well-known for their high volatility and unpredictability, posing a challenge for forecasting using traditional methods. To address this issue, we explore variations of the N-BEATS deep learning (DL) architecture by adding convolutional network layers, Transformer mechanisms, and the Mish activation function, and propose a novel approach for forecasting cryptocurrency portfolios. Our comprehensive evaluation demonstrates that our model variations outperform other DL and traditional forecasting methods in numerous evaluation metrics, making them powerful tools for predicting cryptocurrency prices and portfolios in the rapidly-evolving cryptocurrency market. Furthermore, our newly proposed N-BEATS Perceiver model, a Transformer-based N-BEATS variation, exhibits a robust risk profile with less downside compared to other models and performs exceptionally well when evaluated using the TOPSIS method across a wide range of portfolio evaluation parameters. These results underscore the potential of our approach and specifically highlight the N-BEATS Perceiver's potential for selecting portfolios and forecasting cryptocurrency prices, offering valuable insights into the development of more accurate and reliable models for cryptocurrency forecasting.