Showing posts with label computer science. Show all posts
Showing posts with label computer science. Show all posts

4 August 2025

Methodological Myopia of AI Research

For all the dizzying progress in artificial intelligence, a striking criticism remains: the field's persistent reliance on a limited set of methodologies, often to the exclusion of decades of established wisdom from other disciplines. It is as if a generation of researchers, armed with a powerful new hammer, has declared every problem a nail, ignoring the screwdrivers, wrenches, and specialized tools available in the intellectual shed. This methodological myopia, a form of intellectual tunnel vision, often leads to a frustratingly obtuse approach to problem-solving, hindering true innovation and making the process of building intelligent systems more difficult and less robust than it needs to be.

The prevailing paradigm in modern AI research often defaults to statistical, data-driven approaches, particularly deep learning and high-level statistical modeling. This method, while incredibly effective for certain tasks like pattern recognition and classification, is applied almost universally. Researchers often force this singular approach onto problems that are inherently better suited to structured, symbolic, or rule-based reasoning. This is a perplexing phenomenon, especially when looking at fields like computer science, where decades of engineering have produced robust and elegant solutions for managing complexity. The entire architecture of the World Wide Web, for example, is built on established design patterns, structured data formats, and logical protocols. Similarly, most modern programming languages rely on well-defined grammars, types, and modular architectures to manage and scale complex systems.

The AI community’s reluctance to seriously engage with these established structured approaches is a source of immense frustration. It is like watching a carpenter attempt to build a house by only swinging a mallet, while ignoring the detailed blueprints, precise measurements, and specialized joinery techniques that have been perfected over centuries. This single-minded focus on statistical correlation over causal or logical structure can be incredibly inefficient. Instead of leveraging established design patterns for knowledge representation or reasoning, researchers often resort to complex, hair-pulling statistical workarounds to solve problems that could be addressed with a more elegant, structured solution.

Can AI researchers be this obtuse? The answer is likely rooted in a combination of factors: the momentum of a field dominated by a few highly successful paradigms, the siren song of novel research publications, and a potential lack of cross-disciplinary training that would expose them to these alternative methods. The result is a cycle of reinventing the wheel, where a problem is shoehorned into a statistical framework that requires vast amounts of data and computational power, when a more thoughtful, structured design could have achieved a more efficient, explainable, and reliable outcome.

Moving forward, the field of AI would benefit greatly from a more eclectic and interdisciplinary approach. By integrating the established design patterns of software engineering, the logical rigor of formal systems, and the causal reasoning of other sciences, AI can move beyond its current methodological rut. It is time for researchers to look beyond the hammer and embrace the full toolbox, creating more flexible, powerful, and ultimately more intelligent systems.

17 July 2025

Beyond Recursion

Recursion, a foundational concept in computer science, often captivates with its elegant, self-referential solutions to complex problems. Defined by a function calling itself to solve smaller instances of the same problem, it can lead to remarkably concise code, particularly for tasks involving tree structures or mathematical sequences. However, beneath this allure lies a set of significant problems that often render recursion problematic, inefficient, and even unsafe for production-grade software, especially when compared to alternative programming paradigms and approaches.

One of the most critical issues with recursion is the risk of stack overflow. Each recursive call adds a new frame to the program's call stack. For deep recursion, or when dealing with large datasets, this stack can quickly consume all available memory, leading to a StackOverflowError and program termination. This makes recursion inherently memory-inefficient for many practical scenarios, as the overhead of managing numerous stack frames can be substantial. Furthermore, the performance overhead associated with function calls (context switching, parameter passing, return address management) can make recursive solutions significantly slower than their iterative counterparts, even if a stack overflow is avoided.

Beyond resource consumption, recursion can introduce increased complexity and debugging challenges. While the initial recursive definition might appear simple, tracing the execution flow and understanding the state at each recursive step can be notoriously difficult. This complexity often makes identifying and fixing bugs more arduous compared to a clear, step-by-step iterative loop. The implicit state management through the call stack, though elegant, obscures the program's flow, making it harder to reason about, particularly for developers less familiar with the recursive pattern.

Given these drawbacks, several alternative paradigm shifts and approaches offer more compelling, efficient, simpler in complexity, and memory-safe ways to program.

The most direct alternative is iteration. Any problem solvable with recursion can also be solved with iteration, typically using loops (e.g., for, while). Iterative solutions manage state explicitly, often with a few variables, rather than relying on the call stack. This direct control over memory usage and execution flow makes iterative programs inherently more memory-safe by avoiding stack overflow issues and generally more performant due to reduced function call overhead. For instance, calculating factorials or traversing a list iteratively is clearer, more efficient, and less prone to errors than their recursive equivalents.

In the realm of functional programming, tail recursion optimization (TCO) offers a partial mitigation. A tail-recursive function is one where the recursive call is the very last operation performed. Compilers or interpreters capable of TCO can optimize these calls into iterative loops, effectively eliminating the stack overhead. While this addresses the stack overflow problem and improves performance, it requires specific language support and careful structuring of the recursive function, which might not always be intuitive or possible in all contexts. Languages like Scheme and Scala often support TCO, but it's less common or not guaranteed in others like Python or Java.

Beyond direct iterative translation, data structures and algorithms designed for specific problems can often provide more efficient solutions than general-purpose recursion. For graph traversal, explicit stack or queue data structures can be used to implement Depth-First Search (DFS) or Breadth-First Search (BFS) iteratively, offering fine-grained control over memory and execution. Similarly, dynamic programming, which often involves building up solutions from subproblems and storing intermediate results (memoization), avoids redundant computations inherent in naive recursive solutions, leading to significant performance gains and often being implemented iteratively.

Finally, adopting a problem-solving mindset that favors explicit state management and clear control flow over implicit recursive calls can lead to more robust and maintainable code. Object-oriented programming, for example, might encapsulate state within objects and use methods to manipulate that state iteratively. Event-driven programming or reactive programming paradigms focus on responding to events and managing asynchronous flows, often using callbacks or streams, which inherently steer away from deep recursive call chains.

While recursion holds a place for its conceptual elegance in specific scenarios, its practical limitations regarding stack overflow, performance overhead, and debugging complexity make it a problematic choice for many real-world applications. Embracing iterative approaches, leveraging tail recursion where supported, employing appropriate data structures and algorithms, and adopting paradigms that prioritize explicit state management and clear control flow are more compelling, efficient, simpler in complexity, and memory-safe alternatives for building robust and scalable software.

21 May 2024

Emerging Applications of GNN

  • Recommender Systems
  • Computer Vision
  • Natural Language Processing
  • Program Analysis
  • Software Mining
  • KG Mining for Drug Discovery
  • Predicting Protein Function and Interaction
  • Anomaly Detection
  • Urban Intelligence
  • Stock Market Prediction
  • Asset Management
  • Startup Prediction
  • Supply Chain Management
  • Traffic Prediction
  • Crisis Prediction
  • Weather Forecasting
  • Explainable AI
  • Wireless Communication
  • Cybersecurity
  • Web Crawling & Harvesting
  • Customer Relationship Management
  • Robotics
  • ...

19 November 2023

Coding Tests

Organizations use third-party coding platforms for testing candidates as part of recruitment process.  Examples of such platforms include: HackerRank, Leetcode, Codility, Qualified, among others.  In many respects, use of such platforms in recruitment practice is counterproductive for several reasons, as stated below. 

  • The problem statement is usually unclear and not defined in similar terms that would be practical for a business case
  • Often the problem is defined in mathematical terms which is likely to confuse the candidate
  • The testing environment is often buggy
  • Tests are very localized and mundane
  • Tests can drive bad practices
  • Tests can reflect problems that candidate will never have to solve in practice
  • Tests have incorrect test cases
  • Tests are erratic
  • Tests don't lend themselves very well to practical business use cases
  • Tests ignore disabilities, social adjustments, and are counter to diversity, inclusion, and equity
  • Tests have tedious edge cases and ambiguous logic
  • Tests develop a sense of social distrust especially with experienced candidates
  • Tests have questions that are not tailored to skills required for the job
  • Candidates can pass even if they lack the necessary skills for the job
  • Candidates who have a lot of practice on the platform can game the system
  • Harder to code in an unfamiliar environment
  • Tests can filter out good candidates leaving mediocre and average candidates
  • Tests tend to be based on algorithmic skill rather than the ability to code
  • Tests require time which can be defined as chargeable time especially if it requires developing a model
  • Tests are often bookish in nature and rarely a reflection on a candidate's experience
  • Tests can reset haphazardly in middle of a session
  • Tests tend to be timed meaning they don't provide sufficient flexibility to candidates to fit into their busy schedules
  • Tests can be done using Generative AI

2 October 2022

Citation Analysis

Scientific research is a social activity defined in a set of norms. The key norms dispel the motives behind how research activities are dispensed, shared, and evaluated.

  • Universalism
  • Communism
  • Disinterestedness
  • Organized Skepticism

15 May 2022

Foundations of Mathematics

One of the oddest thing in the machine learning and the data science community is the complete discredit of logics. The fact of the matter is that without logics nothing is possible. In fact, logic is the basis of computation. One can derive bayesian statistics from the axiomatization of logics. It is quite shocking that many statisticians never gain the foundational appreciation of logics. In fact, when one looks at decision theory they are back in the world of logics. Statistics is built on three foundational elements of mathematics: Logics, Arithmetic, and Set Theory.

The following books highlight the embedded logics in probability and statistics.

21 March 2022

Devopedia

Devopedia

Bitcoin Investing

There has been a recent influx of interest in bitcoin investing in the markets. People that had invested $10 per bitcoin back in the day are likely now worth in thousands. This may be a grandiose return but at the end of the day it is not investment it is more of a speculation. Although rewards are high, the returns can be exceptionally risky in the higher margin of volatility. Not to mention the fact that capital gains tax calculations can be tricky. And, then there is a lot of fraud associated with cryptocurrencies. The valuation can also be difficult to calculate for bitcoin in real terms. There is also that aspect of limited acceptance within a wide spectrum of markets which makes conversion into cash at times difficult. The magic percentage to bitcoin is 1%, any more and one has an exceptionally high risk to return ratio which may not often provide the right level of long term expectations on the highly volatile cryptomarkets.  Undeniably, if one looks at it, paper money tends to be worthless, but digital currency in real terms is even more worthless. Any security needs to be backed by something. What is a bitcoin backed by? Some form of currency? What is the asset value of a bitcoin? There is no sensible regulation, no sense of protection. At least, not one that has been unanimously agreed across jurisdictions. It is the underground currency so to speak in the digital universe.

1 January 2022