🧭 Mentorship plan
Written from the value chain only: the original document was not available.
This mentorship plan guides learners through building an AI-driven prescriptive lending framework for SMEs. It covers liquidity forecasting with TimesFM, strategic intervention using an RL agent, and personalized communication via an LLM, focusing on practical implementation and critical understanding of AI applications in finance.
Pace rule: Each step starts with a question. The learner answers it in their own words, then does the task. A step's typical days are the time given. A learner who has not answered by then is not chased: the mentor moves on to learners who are moving, and the door stays open for when they return.
Who this is for
Final-year university students or junior engineers with a foundational understanding of programming, basic machine learning, and an interest in FinTech.Starting point
Learners must be proficient in Python, comfortable with basic data manipulation (Pandas, NumPy), understand fundamental machine learning concepts (regression, classification), and be familiar with version control (Git).Components
- Component name
- TimesFM Liquidity Forecasting Engine
- Skill areas
- AI
- Data engineering
- Cloud computing
- Why it matters
- This component is crucial for proactively identifying potential liquidity troughs for SMEs by accurately forecasting their End-of-Day (EOD) balances. This foresight enables timely and targeted financial interventions, shifting from reactive to prescriptive lending and enhancing both SME stability and bank value.
- Ladder
Step Question Where to look Student task Mentor checks Typical days 1 What is Mean Absolute Scaled Error (MASE), and why is it particularly useful for evaluating time-series forecasts across different scales and datasets compared to other metrics like RMSE or MAE? Hyndman and Athanasopoulos, 'Forecasting: Principles and Practice', Chapter 2.5 Implement the MASE calculation in Python for two different synthetic time series and their respective simple forecasts (e.g., naive forecast and moving average forecast). Learner's own-words explanation of MASE and its utility. A Python script that correctly computes MASE for the two time series. Pass if explanation is accurate and MASE calculations are correct (within 1% of expected values). 2 2 How does Google's TimesFM, as a decoder-only foundation model, process input time-series data to generate zero-shot forecasts, and what is its expected output format? Google's TimesFM research paper or official Hugging Face documentation for TimesFM Set up a local environment, load a pre-trained TimesFM model, and generate a 30-day forecast for a sample synthetic EOD balance time series (e.g., 90 days of daily data). Learner's own-words explanation of TimesFM's input/output. Python code demonstrating loading the model and generating a 30-day forecast. Output structure matches documentation. Pass if forecast is generated and structure explained. 3 3 Why is fine-tuning TimesFM on specific anonymized historical transaction data from SMEs crucial for improving the accuracy and relevance of liquidity forecasts, compared to using a purely zero-shot, general-purpose model? Concepts of transfer learning and domain adaptation in time-series forecasting literature; TimesFM fine-tuning guides. Outline a privacy-preserving data preparation strategy for anonymized SME transaction data, detailing at least three techniques to ensure data remains confidential while suitable for TimesFM fine-tuning. Learner's own-words explanation of the importance of fine-tuning. A document describing three privacy-preserving techniques (e.g., differential privacy, aggregation, tokenization) and a high-level data flow. Pass if techniques are relevant and well-justified for financial data. 3 4 How can a robust data pipeline be designed to continuously ingest high-frequency EOD balance updates from a core banking system and efficiently feed them into the TimesFM engine for daily forecast generation? Documentation for streaming data platforms (e.g., Apache Kafka, AWS Kinesis) or a textbook on real-time data architectures. Sketch a data pipeline architecture (using a diagram and a brief description) that includes data ingestion, anonymization (referencing step 3), TimesFM inference, and storage of forecasts, suitable for daily operations. Learner's own-words explanation of pipeline design principles. An architectural diagram (e.g., using Mermaid or similar text-based diagramming) and accompanying description. Pass if all key stages from ingestion to forecast storage are present and logically connected. 4 5 What specific challenges do highly irregular or sparse SME transaction data present to TimesFM's forecasting performance, and where would its predictions most likely degrade or become unreliable? Academic papers on time series forecasting with sparse or irregular data, or discussions on the limitations of deep learning models on such datasets. Propose two distinct strategies to mitigate the impact of sparse or irregular transaction data on TimesFM's forecasts, detailing how each strategy would address the identified challenges. Learner's own-words explanation of challenges. A document outlining two strategies (e.g., specialized imputation methods, creating synthetic data segments, using dynamic aggregation windows) and their rationale. Pass if strategies are well-explained and plausible. 3 6 In the context of prescriptive lending, would you prioritize minimizing MASE for short-term (7-day) liquidity forecasts or maximizing the accuracy of identifying future liquidity troughs (potential 'pain points') over a longer horizon (30-day), and why? The value chain description's 'key variable' for TimesFM, and general business objectives of prescriptive lending. Based on your chosen priority, define a composite evaluation metric that quantitatively balances predictive accuracy with the business objective of identifying liquidity troughs for proactive intervention. Learner's own-words justification for their prioritization. A clear definition of a composite metric (e.g., weighted MASE + trough detection recall) with rationale for its components and weights. Pass if the metric aligns with the chosen priority. 3 7 Given anonymized SME EOD balance data, how can we achieve a MASE of less than 0.7 for 30-day forecasts for at least 80% of SMEs, while also reliably identifying at least one significant liquidity trough per SME? Actual fine-tuned TimesFM model, provided anonymized SME data, and the MASE calculation from Step 1. Using a fine-tuned TimesFM (or a pre-trained one with appropriate data), generate 30-day forecasts for 10 diverse anonymized SME EOD balance time series. Calculate MASE for each and visually mark identified liquidity troughs. Learner's own-words explanation of their approach to achieving the target. Python code for generating forecasts and calculating MASE. A report with 10 forecast plots, each showing the 30-day prediction, calculated MASE, and marked troughs. Pass if MASE < 0.7 for at least 8 SMEs, and troughs are visually identifiable in most cases. 5 - Common mistakes
- Incorrectly applying MASE to non-seasonal data or without proper scaling.
- Ignoring the specifics of TimesFM's input requirements, leading to poor data preparation.
- Underestimating the complexity of privacy-preserving data handling for financial data.
- Designing a data pipeline that lacks robustness for real-world banking loads or error handling.
- Failing to account for severe data sparsity or irregularity, leading to 'garbage in, garbage out' forecasts.
- Not clearly defining 'liquidity trough' or neglecting its importance in the evaluation metric.
- Overlooking the practical aspects of integrating and monitoring the forecasting engine in a production environment.
- Component name
- RL-driven Strategic Intervention Agent
- Skill areas
- AI
- Data engineering
- Cloud computing
- Why it matters
- This agent is the core decision-making unit, leveraging forecasts and market signals to determine the optimal timing and nature of loan offers. Its effectiveness directly translates to maximizing customer utility (by solving pain points) and bank LTV (by strategic engagement) while managing default risk, driving the 'prescriptive' aspect of the lending framework.
- Ladder
Step Question Where to look Student task Mentor checks Typical days 1 What are the four fundamental components of a Markov Decision Process (MDP) (State, Action, Transition Probability, Reward), and how do they collectively define an environment for a Reinforcement Learning agent? Sutton & Barto, 'Reinforcement Learning: An Introduction', Chapter 3 Define the State, Action, Transition Probability, and Reward for a very simple RL environment where an agent interacts with an SME that can either be 'cash-rich' or 'cash-poor', and the agent can 'offer loan' or 'do nothing'. Learner's own-words explanation of the four MDP components. A written definition of each component specific to the simple SME scenario. Pass if all four are correctly identified and briefly described in the context. 2 2 How does Proximal Policy Optimization (PPO) provide a stable and efficient method for training policy-based Reinforcement Learning agents, specifically addressing the challenges of large policy updates that can destabilize training? PPO research paper ('Proximal Policy Optimization Algorithms') or Stable Baselines3 PPO documentation (algorithm description section). Implement a basic PPO agent using a library like Stable Baselines3 or Ray RLlib to solve a standard continuous control task, such as the 'Pendulum-v1' environment in OpenAI Gymnasium. Learner's own-words explanation of PPO's stability mechanisms (e.g., clipping, multiple epochs). A working Python script that trains a PPO agent on Pendulum-v1, achieving a cumulative reward of at least -200 over 100 episodes. Pass if code runs and explanation is clear. 3 3 How can diverse data sources like TimesFM's 30-day liquidity forecasts, external market signals (e.g., FRED/LME commodity prices), and identified purchase signatures be effectively encoded into a unified observation space for the RL agent within a Gymnasium environment? OpenAI Gymnasium's `observation_space` documentation and examples of custom environment design. Define a `gym.spaces` compatible observation space (e.g., `Box` or `Dict`) for the RL agent. This should include a TimesFM forecast vector (e.g., next 7 days' predicted balances), a vector of 3 market indices, and a binary flag for 'high-value purchase signature detected'. Learner's own-words explanation of encoding rationale. Python code defining the `observation_space` using `gym.spaces`. Explanation of why each data type is chosen for specific observations. Pass if definition is correct and well-justified. 3 4 Why is a multi-objective reward function essential for this RL agent, and how can potentially conflicting objectives such as 'customer utility' (e.g., savings), 'bank revenue' (e.g., interest earned), and 'default risk' (e.g., penalty) be integrated and balanced within a single reward signal? Literature on multi-objective reinforcement learning or reward shaping techniques; venture's KPI delta. Draft a multi-objective reward function for the RL agent. Assign initial weighting coefficients (e.g., 0.5 for customer utility, 0.3 for bank revenue, -0.2 for default risk penalty) and justify these choices in the context of the venture's overall goals and KPI delta. Learner's own-words explanation of the need for multi-objective rewards. A document presenting the reward function (e.g., `R = w1*R_customer + w2*R_bank + w3*R_default_penalty`) with clear definitions of each sub-reward and justifications for assigned weights. Pass if function is logical and weights are justified. 4 5 What strategies can be implemented to prevent the RL agent from learning short-term greedy policies (e.g., pushing high-interest loans regardless of SME's true need) that could damage long-term customer relationships or significantly increase default risk, and where might the current reward function inadvertently encourage such behavior? Ethical AI guidelines for financial services, academic papers on safe reinforcement learning or reward hacking, venture's institutional shift matrix (social aspect). Identify one specific scenario where your drafted reward function might incentivize undesirable short-term behavior. Propose an adjustment to the reward function or an additional constraint within the environment to mitigate this risk, and explain how it would work. Learner's own-words explanation of the problem. Scenario description and a proposed solution (e.g., adding a long-term relationship term to reward, penalizing early loan defaults more heavily, implementing a 'cooling-off' period for offers). Pass if the solution is creative and addresses the issue directly. 3 6 How can a basic simulation environment for an SME's financial state be constructed to allow for training and evaluation of the RL agent, incorporating simplified cash flow dynamics, responses to loan offers, and the impact of market fluctuations? Principles of discrete-event simulation, basic financial modeling concepts. Develop a simplified Python class that simulates an SME's daily financial state. It should track EOD balance, process fixed daily expenses, simulate irregular income/outflows (e.g., purchase signatures), receive loans, and update its state. It should also have a 'liquidity_trough_flag' that activates when balance drops below a threshold. Learner's own-words explanation of the simulation logic. A Python class that accurately simulates SME balance changes, loan receipts, and flags liquidity troughs over a simulated period (e.g., 30 days). Pass if simulation logic is sound and trough detection works. 4 7 How can a PPO agent be trained within a custom Gymnasium environment, integrating simulated TimesFM forecasts and an SME financial model, to consistently identify and intervene during simulated liquidity troughs, resulting in a positive combined reward? Gymnasium documentation for creating custom environments, Stable Baselines3 or Ray RLlib documentation for PPO training. Create a custom Gymnasium environment using your SME simulation (from step 6) and simulating TimesFM forecasts (e.g., by inputting a pre-defined 'trough' scenario). Train a PPO agent for 10,000 timesteps within this environment. Demonstrate one successful episode where the agent offers a loan during a simulated liquidity trough, leading to a positive cumulative reward. Learner's own-words explanation of the integration. Working Gymnasium environment, PPO training script, and a plot or log showing a successful episode where the agent makes a timely intervention during a trough, and the episode's cumulative reward is positive. Pass if the agent demonstrates learning to intervene appropriately and achieves a positive reward. 5 - Common mistakes
- Poorly defined state or action spaces, making the problem difficult for the RL agent to learn.
- Reward function that is too sparse or misaligned with business objectives, leading to suboptimal policies.
- Ignoring the 'exploration vs. exploitation' dilemma, resulting in agents stuck in local optima.
- Overly complex simulation environment that hinders debugging and learning efficiency.
- Not accounting for the non-stationary nature of real-world financial data in simulations.
- Failing to integrate TimesFM forecasts correctly into the observation space, rendering them useless.
- Overlooking the computational resources required for RL training and simulation.
- Component name
- Prescriptive Messaging Layer (LLM)
- Skill areas
- AI
- Business and operations
- Why it matters
- This layer translates the complex AI decisions from the RL agent into clear, persuasive, and personalized messages for SMEs. Its ability to communicate effectively determines engagement and conversion rates, making the entire prescriptive lending framework actionable and impactful for the end-user. It ensures compliance and maintains the bank's brand voice.
- Ladder
Step Question Where to look Student task Mentor checks Typical days 1 What are 'prompt engineering' and 'in-context learning' in the context of Large Language Models (LLMs), and why are they fundamental for guiding an LLM's output without extensive fine-tuning? OpenAI API documentation on prompt engineering, or research papers/blogs explaining in-context learning in LLMs. Write three distinct prompts for a publicly available LLM (e.g., ChatGPT, Gemini, Llama 2 local) to generate short, persuasive loan offer messages. Each prompt should target a different SME 'pain point' (e.g., rising raw materials, seasonal inventory build-up, equipment upgrade opportunity). Learner's own-words explanation of prompt engineering and in-context learning. Three distinct prompts and the LLM's generated messages. Pass if prompts clearly direct the LLM and messages are relevant to the pain points. 2 2 How can the RL agent's output (e.g., optimal loan amount, recommended timing, identified pain point, potential savings) be dynamically inserted into an LLM prompt template to generate a highly personalized message for a specific SME? Python f-string formatting documentation, or Jinja2 templating engine documentation. Create a Python script that takes a dictionary of simulated RL agent outputs (e.g., `{'loan_amount': 'Rs. 750,000', 'savings_percentage': '7%', 'commodity': 'cement', 'action_timing': 'within 5 days', 'pain_point': 'rising raw material costs'}`) and uses it to fill in a pre-defined LLM prompt template. Learner's own-words explanation of dynamic prompt generation. Python script and the resulting dynamically generated prompt. Pass if all dynamic variables are correctly inserted into the template. 2 3 Why are consistent tone-of-voice guidelines crucial when using an LLM for financial communication, especially to maintain a bank's brand identity, build trust, and ensure messages resonate appropriately with diverse SME clients? Marketing and branding guidelines for financial institutions, or general communication best practices for trust-building. Define three key tone-of-voice attributes (e.g., 'professional', 'empathetic', 'action-oriented') suitable for a commercial bank offering prescriptive loans. For each attribute, provide specific examples of phrases or sentence structures that embody it in a loan offer message. Learner's own-words explanation of the importance of tone-of-voice. A document outlining three attributes with clear supporting phrase examples. Pass if attributes are relevant and examples demonstrate understanding. 3 4 How can an LLM be effectively constrained or guided through prompt engineering to produce loan offer messages that are not only personalized and persuasive but also compliant with basic financial regulations (e.g., avoiding guarantees of returns, ensuring clarity of terms, including disclaimers)? General financial advertising regulations (e.g., SBP guidelines, SEC principles of fair disclosure) and LLM safety/alignment research papers on prompt-based guardrails. Modify one of your prompt templates from Step 1 by adding specific, explicit instructions or 'guardrails' to ensure the LLM generates a message that avoids misleading claims, includes a clear call to action, and incorporates a general disclaimer about variable terms and conditions. Learner's own-words explanation of prompt-based compliance. Modified prompt and the LLM's generated message. The message should clearly include a disclaimer and avoid making any prohibited claims. Pass if prompt effectively enforces compliance aspects. 3 5 What ethical safeguards, beyond simple compliance prompts, are necessary to prevent the LLM from generating potentially predatory, biased, or misleading financial advice, particularly given its ability to craft highly personalized and persuasive language? Ethical AI principles for finance, articles on algorithmic bias and fairness in lending, discussions on LLM's persuasive capabilities. Identify one specific scenario where a compliance prompt alone might be insufficient to prevent unethical output (e.g., subtly exploiting an SME's desperation). Propose a human-in-the-loop mechanism or an additional technical check to mitigate this ethical risk. Learner's own-words explanation of ethical considerations. Scenario description and a proposed safeguard (e.g., human review of all high-value or 'distress' offers, automated sentiment analysis on generated messages, diversity checks on message variations). Pass if the safeguard is practical and addresses the ethical concern. 3 6 In crafting prescriptive loan messages, which trade-off would you prioritize: maximizing persuasiveness (aiming for highest conversion rates) or ensuring absolute clarity and stringent regulatory compliance, and why, considering the target audience (Pakistani SMEs) and the sensitive financial context? Business ethics in financial services, regulatory frameworks for financial products in Pakistan (e.g., SBP regulations), and the commercialization pathway's 'institutional shift matrix' (social aspect). Justify your chosen trade-off with reference to local context (Pakistan) and the venture's objectives. Then, propose two specific metrics (beyond simple conversion rate, e.g., customer satisfaction surveys, clarity scores, complaint rates) to evaluate the success of your preferred messaging approach. Learner's own-words explanation and justification of their chosen trade-off. Two well-defined metrics for evaluating success, with rationale for their selection. Pass if justification is sound and metrics are relevant. 4 7 How can we develop 5 distinct LLM prompt templates, each tailored to a specific SME pain point, dynamically integrating 3-5 variables from the RL agent, and consistently generating messages that are personalized, persuasive, and include a basic regulatory disclaimer? Outputs from previous steps, LLM documentation, and internal style guides. Create five distinct LLM prompt templates, each targeting a different SME pain point (e.g., rising raw materials, seasonal inventory, equipment upgrade, unexpected cash flow gap, expansion opportunity). Demonstrate the output of these templates using diverse simulated RL agent data, ensuring personalization, persuasiveness, and a disclaimer in each message. Learner's own-words explanation of prompt design. Five distinct prompt templates with dynamic placeholders. Five example generated messages for different scenarios, each demonstrating personalization, persuasiveness, and a disclaimer. Pass if templates are robust and generated messages meet all criteria. 5 - Common mistakes
- Generating generic messages that lack personalization or impact.
- Overlooking cultural nuances and local language in message phrasing for Pakistani SMEs.
- Failing to adequately incorporate compliance guardrails, leading to legally problematic outputs.
- Not rigorously testing the LLM's output for bias or unintended interpretations.
- Making prompts too complex, leading to inconsistent or nonsensical LLM responses.
- Ignoring the importance of clear calls to action or follow-up instructions in the messages.
- Underestimating the ongoing effort required for A/B testing and refinement of message effectiveness.
Mentor guidance
- Emphasize that the question must be answered *before* the task. The explanation in their own words is critical for demonstrating understanding.
- Encourage learners to use AI tools (e.g., ChatGPT, Claude) to *find* answers and understand concepts, but then to *explain them themselves* and *apply them practically*.
- Focus on the learning process, not just task completion. If a learner struggles, guide them to the right resources or clarify the question, rather than providing the answer.
- Do not extend deadlines for steps. This fosters accountability and time management.
- The pass mark is a minimum bar; encourage striving for excellence and deeper understanding.
- Actively ask follow-up questions during checks to gauge depth of understanding, especially for 'why' and 'what if' questions.
Assumptions
- The value chain document provided is the *only* source of truth for the project's requirements, constraints, and targets.
- Access to an LLM API (e.g., OpenAI, Google Gemini) or a local LLM setup is available for the LLM component.
- Access to sufficient computational resources (e.g., cloud GPU instances) for training and fine-tuning AI models is available.
- Basic anonymized SME transaction data, or synthetic data with similar characteristics, will be provided for TimesFM training/evaluation and RL environment simulation.
- No external documentation beyond what is explicitly mentioned in `where_to_look` fields is relied upon.
Prepared by InnoQuest's AI from the uploaded document. Check every number before relying on it; assumptions are listed above.