Thursday, June 19, 2025

No AI at coding interviews: Prioritizing algorithmic thinking

When evaluating senior engineer candidates, it's vital to focus on pure algorithmic thinking rather than their ability to manipulate AI tools. The essence of a senior-level engineering role rests on creative problem-solving, thoughtful reasoning, and an in-depth understanding of algorithms. Relying on AI during live coding assessments risks masking a candidate's true capability. If a candidate solely depends on AI-generated solutions, it becomes difficult to gauge whether they possess the foundational skills necessary for high-level design and complex decision-making.

There’s a compelling argument for designing interviews that first filter for candidates who demonstrate strong independent cognitive processes. Once that baseline is established, integrating AI coding tools into later evaluation stages—such as onboarding or specialized training programs—can be a valuable extension. This phased approach ensures that candidates have proven their capacity for raw problem-solving and originality before leveraging AI as a productivity tool. In this way, the interview process remains a pure measure of human ingenuity while aligning with an evolving, AI-supported workplace culture.

Critics of a strict no-AI policy in technical interviews point out that the modern workplace increasingly relies on AI to boost productivity and streamline tasks. They argue that an “AI-first” culture is not just the future, but the present, necessitating that candidates show proficiency in guiding AI to produce optimal results. However, there is a clear distinction between using AI for supplementary functions, such as refreshing syntax knowledge or aiding in non-critical tasks, and relying on it to do the heavy cognitive lifting of problem solving. A candidate who enhances their thinking with AI might still possess excellent strategic skills, but the immediate challenge remains: identifying true algorithmic talent without any external computational aid.

The ideal hiring process should strike a balance—ensuring that candidates can solve tasks independently while gradually introducing AI-based tools as part of their professional development. This approach not only validates their deep-rooted technical abilities but also ensures that they are well-equipped to integrate with a future-facing, AI-augmented work environment. Ultimately, the best engineers will be those who showcase exceptional problem-solving prowess first and then learn to harness AI to amplify their contributions. 

Thursday, June 5, 2025

AI agents: Data, Action and Orchestration

Let's explore how modern AI agents are built using three broad categories of tools—Data, Action, and Orchestration—and then see how these relate to concepts like retrieval augmented generation (RAG) and memory, along with the collaborative architectures of multi-agent systems.

1. Types of AI Agent Tools

  • Data Tools Data tools are the workhorses for gathering, processing, and refining information. They enable agents to query databases, retrieve web data, or parse documents, creating the critical knowledge base an AI uses to generate insights. In many applications, these systems incorporate retrieval augmented generation (RAG) techniques. Traditional RAG methods pull in relevant external information to support generative models, while agentic RAG goes further by granting the agent autonomy—allowing it to decide when and what additional data to retrieve based on its goals. This dynamic retrieval makes the process not only reactive but also proactive in achieving task-specific outcomes.

  • Action Tools Action tools empower an AI to affect change in its environment. They include APIs, control systems, or robotic actuators that transform decisions into real-world or digital actions. These tools enable the agent not just to talk about tasks but to execute them: from sending messages and updating records to controlling machines or interfacing with other software systems.

  • Orchestration Tools When complex tasks require multiple specialized agents or modules, orchestration tools step in as the conductors of the system. They manage workflows, coordinate tasks among various sub-agents, and ensure that all actions align with the overarching goals. This coordination is crucial in systems where different processes must work together seamlessly—whether they’re organized in a hierarchy or running in parallel.

2. Data vs. Agentic RAG

In traditional RAG, the agent uses a fixed strategy to retrieve information—essentially tapping into a data reservoir to enhance its responses. In contrast, agentic RAG embodies a more dynamic approach. Here, the agent actively determines what to fetch, when to fetch it, and how best to integrate that data into its outputs. This level of agency means the retrieval process adapts in real time, tailored to the context of the ongoing task and the agent’s evolving objectives.

3. Memory in AI Agents

Memory plays a pivotal role in the effectiveness of AI systems:

  • Short-Term Memory This is the agent’s active workspace. It holds context during a conversation or session, enabling the AI to keep track of the immediate flow of information and maintain coherent interactions over the span of a single task or dialogue.

  • Long-Term Memory In contrast, long-term memory allows the agent to store information across multiple sessions. This could include user preferences, historical interactions, or accumulated experience. By leveraging long-term memory, AI agents can offer more personalized service over time and adapt their behavior based on past interactions.

4. Multi-Agent Architectures

Modern AI systems often deploy collaborative architectures to manage complex tasks:

  • Multi-Agent Crews These are teams of agents that work on different aspects of a problem concurrently. Each agent may specialize in a particular domain, and together they pool their expertise to handle intricate or multifaceted challenges.

  • Hierarchical Systems In a hierarchical setup, agents are arranged in layers. Higher-level agents set strategic goals and delegate tasks to lower-level ones, which handle more granular, tactical operations. This structure mirrors organizational hierarchies where executive decisions filter down to operational actions.

  • Parallel Agents With parallel agents, multiple entities operate concurrently and independently on different subtasks. Their outputs are later integrated, enabling the overall system to perform large-scale tasks efficiently without the bottlenecks of serial processing.

Bringing It All Together

By combining data tools (especially those enhanced by agentic RAG), action tools, and orchestration tools, modern AI agents achieve a balance between data-driven insight and effective execution. Integrating short-term and long-term memory enhances contextual understanding and personalization, while multi-agent architectures—whether it be multi-agent crews, hierarchical systems, or parallel agents—allow for scalable and adaptive problem-solving. These design principles are key in enabling AI to operate with both autonomy and cohesion, dynamically adjusting its strategy to meet evolving challenges.

Monday, February 10, 2025

DeepSeek R1: A Path to Advanced Reinforcement Learning

DeepSeek R1 embarks on its journey with the 'zero path' approach, a concept that highlights the system's initial state devoid of any pre-existing knowledge or training. This 'tabula rasa' provides a unique perspective on the capabilities and potential of RL systems when they start from scratch. It sets the foundation for the exploration and learning process that follows, emphasizing the importance of initial conditions in the RL setup.

The foundation of DeepSeek R1's success lies in its meticulous reinforcement learning setup. This phase involves defining the environment, reward functions, and the agents' actions and observations. The setup serves as the playground where the agents interact, learn from their actions, and optimize their strategies to maximize rewards. This section delves into the technical aspects of creating a robust RL environment that fosters effective learning and adaptation.

A standout feature of DeepSeek R1 is its innovative Group Relative Policy Optimization (GRPO) algorithm. GRPO introduces a novel approach to policy optimization by leveraging the relative performance of agent groups. Instead of relying solely on individual performance metrics, GRPO considers the collective performance of agent groups, leading to more stable and efficient policy updates. This section explores the mechanics of GRPO, its advantages, and its impact on the learning process.

The results of DeepSeek R1-zero are a testament to the system's capabilities and the effectiveness of its methodologies. This section presents a comprehensive analysis of the outcomes, highlighting key performance metrics, comparative results, and notable achievements. The data showcases the system's ability to learn, adapt, and optimize its strategies in diverse environments, providing valuable insights into the potential of RL systems.

To enhance the learning process, DeepSeek R1 incorporates a cold start supervised fine-tuning phase. This approach leverages supervised learning techniques to provide a head start to the RL agents. By pre-training the agents on a subset of the environment, the system accelerates the learning process and improves initial performance. This section examines the rationale behind cold start supervised fine-tuning and its impact on the overall learning curve.

Consistency reward for Chain-of-Thought (CoT) is another innovative technique employed by DeepSeek R1. CoT emphasizes the importance of maintaining consistency in decision-making processes, ensuring that the agents' actions align with their long-term strategies. By incorporating a consistency reward mechanism, DeepSeek R1 encourages agents to develop coherent and strategic thought processes. This section explores the implementation and benefits of CoT in the RL framework.

Generating high-quality data for supervised fine-tuning is a critical aspect of DeepSeek R1's success. This phase involves creating diverse and representative datasets that capture various scenarios and challenges within the RL environment. The generated data serves as the foundation for supervised learning, enabling the agents to develop a strong baseline knowledge. This section discusses the methodologies and considerations involved in data generation for supervised fine-tuning.

DeepSeek R1 takes reinforcement learning to the next level by incorporating a neural reward model. This model leverages neural networks to predict and assign rewards based on the agents' actions and states. The neural reward model enhances the system's ability to learn complex and dynamic reward structures, leading to more sophisticated and effective strategies. This section delves into the architecture and implementation of the neural reward model in the RL framework.

The distillation phase in DeepSeek R1 plays a crucial role in refining and optimizing the learned policies. Distillation involves transferring knowledge from a high-capacity model to a more compact and efficient model, ensuring that the distilled model retains the essential knowledge and performance characteristics of the original. This section explores the distillation process, its benefits, and its impact on the overall efficiency and scalability of DeepSeek R1.

DeepSeek R1 represents a significant advancement in the field of reinforcement learning, showcasing a comprehensive and innovative approach to policy optimization and learning. From its zero path beginnings to the incorporation of cutting-edge techniques like GRPO, CoT, and neural reward models, DeepSeek R1 exemplifies the potential of RL systems in tackling complex challenges and achieving remarkable results. As the field continues to evolve, DeepSeek R1 stands as a testament to the power of innovation and meticulous design in the pursuit of advanced artificial intelligence.

Monday, September 16, 2024

Docker vs Orbstack

Orbstack:

  • User Interface and Experience: Orbstack prioritizes an intuitive user interface, making it easier for users to manage containers without extensive DevOps knowledge.
  • Integration: Orbstack offers integrated features within a single platform, reducing the need for external tools.
  • Orchestration: Orbstack includes built-in orchestration capabilities, simplifying the deployment process.
  • Performance: Orbstack aims for optimized performance out of the box.
  • Resource Management: Orbstack provides automated resource management, making it easier to allocate resources efficiently.
  • Security: Orbstack includes robust security features within the platform.

Docker:

  • User Interface and Experience: Docker, while powerful, can have a steeper learning curve.
  • Integration: Docker’s flexibility allows for extensive customization but may require additional tools for complete functionality.
  • Orchestration: Docker relies on additional tools like Docker Swarm or Kubernetes for orchestration tasks.
  • Performance: Docker provides high performance but often requires tuning for specific workloads.
  • Resource Management: Docker offers more granular control, suitable for custom resource management solutions.
  • Security: Docker has extensive security capabilities but typically involves additional configuration and tools.

In summary, Orbstack is designed for ease of use and integrated features, making it ideal for users looking for a straightforward solution. Docker, on the other hand, is known for its versatility and wide adoption, offering extensive customization options and a robust ecosystem.

Sunday, September 1, 2024

Plato's Theory of Forms and Object Oriented Programming

When I first heard about Plato's Theory of Forms I immedately had the thought that this is very similar to the basic concepts of Object Oriented Programming (OOP). So let's see what are the similarities between the 2 concepts.

Abstract Concepts

  • Plato's Theory of Forms: Plato posited that non-material abstract forms (or ideas) represent the most accurate reality. For example, the concept of a "circle" exists perfectly in the realm of forms, while any physical circle is just an imperfect representation.
  • OOP: In OOP, classes are abstract blueprints for creating objects. A class defines the properties and behaviors that the objects created from it will have, similar to how forms define the essence of things.

Instances and Representations

  • Plato's Theory of Forms: Physical objects are mere shadows or instances of these perfect forms. They participate in the form but are not the form itself.
  • OOP: Objects are instances of classes. They are concrete representations of the abstract class, embodying the properties and behaviors defined by the class.

Hierarchy and Inheritance

  • Plato's Theory of Forms: Forms can have hierarchical relationships. For example, the form of "animal" can encompass the forms of "dog," "cat," etc.
  • OOP: Inheritance allows classes to derive from other classes, creating a hierarchy. A base class (like "Animal") can have derived classes (like "Dog" and "Cat") that inherit its properties and methods.

Universality and Reusability

  • Plato's Theory of Forms: Forms are universal and can be applied to many instances. The form of "beauty" can be found in various beautiful objects.
  • OOP: Classes are designed to be reusable. A class can be instantiated multiple times to create different objects that share the same structure and behavior.


More links on the topic:

The history of philosophy notes #2 - Socrates and Plato gets to Forms

Charmides is a dialogue that explores the concept of temperance (self-control or moderation). Socrates engages with the young and beautiful Charmides, attempting to define temperance. Various definitions are proposed, such as temperance being quietness, modesty, or doing one's own business, but Socrates refutes each one. The dialogue ultimately suggests that true temperance involves self-knowledge, but it ends inconclusively, highlighting the complexity of defining virtue.

Euthydemus is a satirical dialogue that contrasts Socratic argumentation with the methods of the Sophists, represented by the brothers Euthydemus and Dionysodorus. The dialogue showcases the logical fallacies and deceptive arguments used by the Sophists, emphasizing the difference between genuine philosophical inquiry and mere rhetorical skill. Socrates demonstrates that true wisdom involves seeking knowledge and understanding, rather than winning arguments through trickery.

Gorgias is a dialogue that examines the nature of rhetoric and its relationship to virtue. Socrates debates with the rhetorician Gorgias, his student Polus, and the politician Callicles. The dialogue explores themes such as the distinction between true and false arts, the nature of power, and the concept of justice. Socrates argues that rhetoric, as practiced by the Sophists, is a form of flattery that lacks genuine knowledge. He asserts that true power lies in self-control and justice, rather than in the ability to persuade others.

Meno is a dialogue that investigates the nature of virtue and whether it can be taught. Socrates and Meno discuss various definitions of virtue, but none prove satisfactory. The dialogue introduces the concept of anamnesis (recollection), suggesting that the soul is immortal and possesses innate knowledge. Socrates demonstrates this idea by guiding Meno's slave to solve a geometric problem through questioning. The dialogue ends in aporia (puzzlement), with no definitive answer to the nature of virtue.

Theaetetus is a dialogue that explores the nature of knowledge. Socrates engages with the young mathematician Theaetetus, examining three definitions of knowledge: knowledge as perception, knowledge as true judgment, and knowledge as true judgment with an account. Each definition is found to be inadequate, and the dialogue concludes without a clear resolution. The discussion highlights the challenges of defining knowledge and the importance of philosophical inquiry.

Phaedo is a dialogue that recounts the final hours of Socrates' life and his arguments for the immortality of the soul. Socrates presents four arguments: the Argument from Opposites, the Theory of Recollection, the Argument from Affinity, and the Argument from the Forms. He asserts that the soul is immortal and that true philosophers should look forward to death as a release from the body. The dialogue ends with Socrates' calm acceptance of his fate and his final moments before drinking the hemlock.