Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: pub@towardsai.net
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Publication

What Is Innateness and Does It Matter for Artificial Intelligence? (Part 1)
Latest   Machine Learning

What Is Innateness and Does It Matter for Artificial Intelligence? (Part 1)

Last Updated on July 24, 2023 by Editorial Team

Author(s): Vincent Carchidi

Originally published on Towards AI.

Source: Wikimedia Commons licensed under the Creative Commons Attribution-Share Alike 4.0 International license.

The question of innateness, in biology and artificial intelligence, is critical to the future of human-like AI. This two-part deep dive into the concept and its application may help clear the air.

By Vincent J. Carchidi

Introduction

Not much good comes out of Twitter these days, but a recent Twitter thread started by artificial intelligence (AI) expert Gary Marcus touched on a fascinating subject: the concept of “innateness” in biological organisms and its relevance for AI. The full Tweet, pictured below, reads: “clear evidence of Innateness — in ants. The contemporary hostility to Innateness in the ML crowd is going to look foolish in hindsight when we figure this all out.”

Source: Gary Marcus on Twitter.

Other experts’ and researchers’ reactions fell along pre-existing lines drawn over recent years in AI research. Thomas Dietterich questioned, “How does declaring something to be innate help us do AI science?,” adding that “The whole idea of pre-training is exactly to create a network with good innate representations.” Judea Pearl chimed in, retorting that “Innateness is…a warning that some knowledge, external to the data, external also to any pre-training, must be encoded in a system to achieve a certain performance.” Rodney Brooks referred to end-to-end learning as a “fetish” while Dietterich, in response, argued that Large Language Models (LLMs) demonstrate that “automated learning can work at internet scale to build a very broad and general system.”

It is not exactly the ideal exchange one can imagine over innateness and intelligence. But Dietterich’s original question is worth asking and answering: Does the concept of innateness help AI researchers?

The question of innateness is critical to future research aiming to design human-like AI systems. While the insertion of this concept into the field has often been messy and contentious, it is simply unavoidable — AI, for the foreseeable future, aims to resemble at least some of the higher-order cognitive abilities of humans. But questions about human cognitive nature are often addressed in the field with over-simplicity, outdated ideas, or outright dismissal of the notion that how humans achieve their feats matters for machine intelligence.

This article presents a deep dive into innateness in biology and AI that aims to clear some of the air and inform the debate on all sides of the aisle. Because the subject is chock-full of multidisciplinary information, this piece is broken up into two parts. The first part is devoted to setting up the background to innateness in humans, structured in a way that avoids familiar frames of analysis in the field. I thus provide a perspective on an innate basis for moral cognition in humans— a topic that, unlike language, has not been caught up in excessive hype of late.

This allows us, in the second part, to bootstrap our way into a discussion of innateness in AI. I home in on two examples in gameplaying AI research — the Go-playing agent AlphaGo Zero and the Diplomacy-playing agent Cicero — and relate the concept of innateness in biology to these agents. Both a high-level and a lower-level overview of these systems’ architectures is provided. While some background knowledge is assumed, the content is written in such a way as to be accessible to a general audience.

Ultimately, these two parts will illustrate how the pursuit of human-like AI, or even Artificial General Intelligence, is directly relevant to innateness.

Table of Contents

Part 1:

· Biological Innateness in Moral Cognition

  • How to Get Interested in Innateness
  • Moral Cognition’s Innate Basis
  • Implications

Part 2:

· Innateness in Artificial Intelligence

  • Gameplaying AIs as Windows Into Artificial General Intelligence
  • Implications

· Conclusion

Biological Innateness in Moral Cognition

The debate over both the robustness of the concept of innateness and whether humans possess innate cognitive endowments is a ripe 2,000-odd years old by now. I do not expect to settle the debate here nor provide a conversation-ending definition of the term. But a personal perspective on this is useful to get our feet wet, which will then be used to bootstrap our way into innateness in biology and AI.

How to Get Interested in Innateness

A significant amount of intellectual energy in my undergraduate and graduate years was spent arguing in favor of the idea that human moral psychology has a powerful, domain-specific, and innate basis in the mind — that is, a specialized cognitive system designated for the generation of moral intuitions, possessing independence from other systems of the mind, like the visual or auditory systems, though constantly required to interface with them in the course of ordinary human behavior. This was unusual, as I studied political science, a discipline that tends to not consider these issues in the detail characteristic of the cognitive and neurosciences.

My motivation came from a source of frustration: I was taking a course on international organizations when the subject of the United Nations’ 1948 Universal Declaration of Human Rights came up, which serves in many ways as the foundation of international human rights activism and law that sprung up in the decades following its adoption. International Relations scholars (a subfield of political science) have many ways of framing this document’s creation and subsequent uses — some focusing on the anti-colonial movements of the first half of the twentieth century and the collapse of empires, others on ideational influences stretching back decades or centuries through political activism and religious traditions, and others still on the distribution of power across countries. Morality — meaning the moral judgments of individuals, the moral norms of particular cultures, and the moral traditions of groups and countries — underwrites much of this.

However, interesting as all that is, one thing irked me: these scholars would write learned tomes on the historical origin of this or that human right in the Universal Declaration, how one religious tradition’s moral values overlap with another’s (or doesn’t), even how the definition of “human” was re-shaped in the first half of the twentieth century leading to a concomitant expansion of moral concern. But virtually all of them made the same, implicit assumption: that morality could be understood in purely social scientific terms.

This seemed implausible to me on its face. Thousands of pages can be written on the evolution of moral norms and customs that find themselves bound up in an international declaration. But how on earth do individuals develop a capacity to generate moral intuitions in the first place? Answering that question, it seems, necessarily shapes how we answer questions related to the development of international human rights norms and laws.

Moral Cognition’s Innate Basis

While moral psychology has since pervaded international relations, much of the debate over innateness remains insufficiently fleshed out. Innateness can mean too many things, too often getting wrapped up in debates about biological determinism.

Instead, to understand human morality, we should employ the same methodological techniques we use to understand any other physical or cognitive system of the body. We thus distinguish between the ability to generate moral intuitions and moral judgments and how this ability is used — the distinction between competence and performance employed throughout the cognitive sciences. Doing this allows us to strip away much of the messiness of social and political life to explain an ability — moral competence — that developmentally healthy humans possess. Our target of explanation in moral psychology, properly conceived, is moral competence, leaving performance to another day.

As legal scholar and philosopher Matthias Mahlmann writes in a recent, major work on moral cognition and human rights: “Nevertheless, the performance of this capacity, the final evaluation of an action can be biased — for example, by the interests of the evaluating person. Consequently, such influences need to be factored out of the analysis if we are to properly study the cognitive competence in question, which is not an easy thing, particularly in empirical work” (p. 403). One can imagine why this is so difficult to do in the social sciences, especially, where the “final evaluation of an action” is frequently bound to empirically irrelevant factors. One can also, as we discuss below, imagine why this is difficult in AI, where systems require some level of human input to probe their competencies.

So, we begin the analysis with the understanding that human beings can intuitively frame the social world in moral terms. As philosopher Susan Dwyer put it: “Moral evaluations, like permissibility judgments and attributions of responsibility, simply cannot get started if we do not already “see” the world in terms of agents, patients, and consequences” (p. 248). But how should we understand this capacity? What explains this ability to “see” the world in these terms?

The next step is to ask what the fundamental properties of these moral evaluations look like. But remember: we cannot simply pick our favorite examples of good or evil and start from there. Nor, furthermore, can we use established ethical taxonomies — like the ethic of autonomy or the ethic of community — as our starting point, as prominent researchers like Jonathan Haidt and Craig Joseph do, because these simply neglect the most basic nature of moral evaluations.

What do I mean by this?

The truth is that moral judgment is deceptive — it is an intimate experience that most human individuals experience throughout their lives, oriented toward emotionally charged social situations and institutional arrangements. But once we have narrowed our focus to moral competence and stripped away the irrelevant factors, moral judgment has “seemingly innocuous” properties with “far-reaching consequences,” as legal scholar John Mikhail puts it. These properties are as follows, drawn from Mikhail’s description here (pp. 45–46):

(1) Novelty: The moral judgments individuals produce have no “point-for-point relationship” between any of the judgments they have produced in the past nor any they have encountered from others.
Elaboration: While moral judgments may seem similar on the surface, they are elicited by circumstances that are entirely novel to the individual. A judgment that one person is wrong to strike another unprovoked sound familiar, but the people involved, the surrounding environment, the actions they take, and so on, are unique. Such a judgment is, then, novel.

(2) Unbounded: An individual can produce, in principle, an unlimited number of moral judgments. There is no limit on the number or kinds of moral judgments an individual can make, save for non-moral constraints like memory, time, etc.
Elaboration: An individual does not merely produce verbalized judgments about situations. Rather, each judgment presupposes mental representations of circumstances that are entirely novel to the individual. A judgment that one person is wrong to strike another unprovoked is not “just a judgment” — it depends on a mental representation of the specific configuration of people, actions, and other variables. The unbounded nature of moral judgments is that these judgments — and the mental representations they presuppose — can be generated by individuals infinitely.

Taken together, the “far-reaching consequences” become apparent. When we attempt to make sense of the ability to produce novel moral judgments on an unbounded scale, we realize that the “finite storage capacity of the brain” rules out the possibility that the brain simply recruits a pre-sorted list of mental representations to produce them. “Instead,” Mikhail writes, “her brain must contain, with respect to moral judgment, something more complex: some kind of cognitive system, perhaps characterizable in terms of principles or rules, that can construct or generate the unlimited number and variety of representations her exercise of moral judgment presupposes.” (Mikhail also uses the language of “a recipe or program of some sort,” which the AI researcher may find more plausible.)

Implications

Lo, and behold, the argument for morality’s innate basis in the human mind comes into view. This innate basis is domain-specific (specialized for the evaluation of moral worth), and innate — that is, basic moral competence, the ability to morally frame and evaluate the world, is unlearned. The specific ways in which humans morally evaluate the world, furthermore, are also unlearned (meaning our moral faculty is not recruited for just any reason — such as, in Mahlmann’s example, assigning virtue to a tree because an apple dropped into the hands of a hungry person).

While it is not a logical impossibility that such an ability could be learned, it would stretch one’s credulity to insert “learning” or “brain-environment interaction” as the primary mechanism responsible for the development of one’s moral competence. While conceptions of innateness vary greatly, it is not at all uncommon to find neuroscientists saying the following: “The superiority of human cognitive learning and understanding compared with existing deep network models may largely result from the much richer and complex innate structures incorporated in the human cognitive system” (p. 693).

By working, then, with the basic properties of moral judgment identified above, we should expect to find complex representations underlying them upon experimental inquiry. Indeed, individuals can be found to impose complex legal and philosophical principles on novel situations intuitively — without having a need to systematically and consciously apply the principles or even having been trained in them formally. Mikhail found, for example, that children responding to classic moral dilemmas posed by developmental psychologists in experimental settings employ an intuition against the legal conception of harmful battery. He thus postulates “an acute sensitivity to the purposeful harmful battery as a property of the human mind” (p. 780). This, we may characterize as innate moral knowledge specified in advance of experience, emerging reliably in the course of biological development. Later research conducted by Sydney Levine, Mikhail, and Alan M. Leslie finds initial experimental support for the idea that intentions are inferred by individuals evaluating novel actions in part by imposing a “presumption of innocence” on other agents.

This picture of the mind is complex — it presumes that “moral intuitions can be understood as the output of a computational process performed over structured mental representations of human action,” as these authors note elsewhere. Experiments probing participants’ intuitions about moral dilemmas using “act trees” supported a long-running theme throughout certain areas of cognitive science: that the mental representations which presuppose moral intuitions are not “exceedingly simple” and cannot be captured “in terms of heuristics and biases” (p. 31).

(Note that it could have turned out, upon experimental inquiry, that moral intuitions’ mental representations were quite simplistic. Were this the case, we may still posit an innate basis for morality, but perhaps not a dedicated cognitive system.)

What all this goes to show is that biological innateness is more than just a matter of what systems of the mind are endowed by genetics in advance of experience and to what extent they are pre-specified with domain-specific knowledge. Rather, it goes to show that such capacities interface with one another productively and without the conscious awareness of individuals. Causal representations of human action, moral intuition, linguistic intuition, and theory of mind, are all operative, in some fashion, in the seemingly simple matter of verbally deeming a novel action to be unjust or immoral.

When dealing with the matter of innateness, then, we understand the following as paramount:

First, positing the innate basis for a human capacity like moral judgment is not straightforward — the most basic properties of moral judgments are deceptively complex, requiring patience and attention to detail to identify them.

Second, once identified, it takes conscious, deliberate effort to tease out the conceptual significance of these basic properties to articulate the broad contours of morality’s innate basis in the mind. In this case, the cognitive system is characterized by rules, principles, or concepts encoded with some moral knowledge.

Third, this cognitive system must interface productively with others in mind, including causal representations of human actions, theory of mind, linguistic cognition, visual cognition, and so on.

Finally, what innateness reveals about human moral judgment is that the intuitions on which they are founded are principled and rely on structured mental representations.

The tricky part is remembering how to conceptualize competence and performance. When we study moral competence, we study it in isolation from the rest of the mind. But we understand that, in ordinary life (and right now), the systems of the mind must routinely interface with one another in productive, dynamic ways. This methodological technique (abstracting the cognitive system away from concrete human behavior) is most difficult when dealing with cognitive functions like moral judgments or linguistic cognition, though we readily employ it elsewhere — the concept of an “immunocompromised” individual only makes sense, for example, if we assume that there is one, idealized immune system that human beings all possess.

With all this in the background, we turn to the creation of artificial minds and how lessons in biological innateness can aid research programs to that end in Part 2.

References

[1] J. Donnelly, Universal Human Rights in Theory and Practice (2013), Cornell University Press.

[2] S. Dwyer, How Good Is the Linguistic Analogy? (2006), The Innate Mind: Vol. 2

[3] M. Finnemore, The Purpose of Intervention (2003), Cornell University Press

[4] A. Getachew, Worldmaking After Empire (2019), Princeton University Press

[5] J. Haidt and C. Joseph, The Moral Mind: How Five Sets of Innate Intuitions Guide the Development of Many Culture-Specific Virtues, and Perhaps Even Modules (2008), The Innate Mind: Vol. 3

[6] M. Keck and K. Sikkink, Activists Beyond Borders (2014), Cornell University Press

[7] S. Levine, A.M. Leslie, J. Mikhail, The Mental Representation of Human Action (2018), Cognitive Science

[8] S. Levine, J. Mikhail, and A.M. Leslie, Presumed Innocent? How Tacit Assumptions of Intentional Structure Shape Moral Judgment (2018), Journal of Experimental Psychology: General

[9] M. Mahlmann, Mind and Rights (2023), Cambridge University Press

[10] J. Mikhail, Any Animal Whatever? (2014), Ethics

[11] J. Mikhail, Elements of Moral Cognition (2011), Cambridge University Press

[12] C. Reus-Smit, Individual Rights and the Making of the International System (2013), Cambridge University Press

[13] D. Traven, Law and Sentiment in International Politics (2021), Cambridge University Press

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.

Published via Towards AI

Feedback ↓

Sign Up for the Course
`; } else { console.error('Element with id="subscribe" not found within the page with class "home".'); } } }); // Remove duplicate text from articles /* Backup: 09/11/24 function removeDuplicateText() { const elements = document.querySelectorAll('h1, h2, h3, h4, h5, strong'); // Select the desired elements const seenTexts = new Set(); // A set to keep track of seen texts const tagCounters = {}; // Object to track instances of each tag elements.forEach(el => { const tagName = el.tagName.toLowerCase(); // Get the tag name (e.g., 'h1', 'h2', etc.) // Initialize a counter for each tag if not already done if (!tagCounters[tagName]) { tagCounters[tagName] = 0; } // Only process the first 10 elements of each tag type if (tagCounters[tagName] >= 2) { return; // Skip if the number of elements exceeds 10 } const text = el.textContent.trim(); // Get the text content const words = text.split(/\s+/); // Split the text into words if (words.length >= 4) { // Ensure at least 4 words const significantPart = words.slice(0, 5).join(' '); // Get first 5 words for matching // Check if the text (not the tag) has been seen before if (seenTexts.has(significantPart)) { // console.log('Duplicate found, removing:', el); // Log duplicate el.remove(); // Remove duplicate element } else { seenTexts.add(significantPart); // Add the text to the set } } tagCounters[tagName]++; // Increment the counter for this tag }); } removeDuplicateText(); */ // Remove duplicate text from articles function removeDuplicateText() { const elements = document.querySelectorAll('h1, h2, h3, h4, h5, strong'); // Select the desired elements const seenTexts = new Set(); // A set to keep track of seen texts const tagCounters = {}; // Object to track instances of each tag // List of classes to be excluded const excludedClasses = ['medium-author', 'post-widget-title']; elements.forEach(el => { // Skip elements with any of the excluded classes if (excludedClasses.some(cls => el.classList.contains(cls))) { return; // Skip this element if it has any of the excluded classes } const tagName = el.tagName.toLowerCase(); // Get the tag name (e.g., 'h1', 'h2', etc.) // Initialize a counter for each tag if not already done if (!tagCounters[tagName]) { tagCounters[tagName] = 0; } // Only process the first 10 elements of each tag type if (tagCounters[tagName] >= 10) { return; // Skip if the number of elements exceeds 10 } const text = el.textContent.trim(); // Get the text content const words = text.split(/\s+/); // Split the text into words if (words.length >= 4) { // Ensure at least 4 words const significantPart = words.slice(0, 5).join(' '); // Get first 5 words for matching // Check if the text (not the tag) has been seen before if (seenTexts.has(significantPart)) { // console.log('Duplicate found, removing:', el); // Log duplicate el.remove(); // Remove duplicate element } else { seenTexts.add(significantPart); // Add the text to the set } } tagCounters[tagName]++; // Increment the counter for this tag }); } removeDuplicateText(); //Remove unnecessary text in blog excerpts document.querySelectorAll('.blog p').forEach(function(paragraph) { // Replace the unwanted text pattern for each paragraph paragraph.innerHTML = paragraph.innerHTML .replace(/Author\(s\): [\w\s]+ Originally published on Towards AI\.?/g, '') // Removes 'Author(s): XYZ Originally published on Towards AI' .replace(/This member-only story is on us\. Upgrade to access all of Medium\./g, ''); // Removes 'This member-only story...' }); //Load ionic icons and cache them if ('localStorage' in window && window['localStorage'] !== null) { const cssLink = 'https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css'; const storedCss = localStorage.getItem('ionicons'); if (storedCss) { loadCSS(storedCss); } else { fetch(cssLink).then(response => response.text()).then(css => { localStorage.setItem('ionicons', css); loadCSS(css); }); } } function loadCSS(css) { const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); } //Remove elements from imported content automatically function removeStrongFromHeadings() { const elements = document.querySelectorAll('h1, h2, h3, h4, h5, h6, span'); elements.forEach(el => { const strongTags = el.querySelectorAll('strong'); strongTags.forEach(strongTag => { while (strongTag.firstChild) { strongTag.parentNode.insertBefore(strongTag.firstChild, strongTag); } strongTag.remove(); }); }); } removeStrongFromHeadings(); "use strict"; window.onload = () => { /* //This is an object for each category of subjects and in that there are kewords and link to the keywods let keywordsAndLinks = { //you can add more categories and define their keywords and add a link ds: { keywords: [ //you can add more keywords here they are detected and replaced with achor tag automatically 'data science', 'Data science', 'Data Science', 'data Science', 'DATA SCIENCE', ], //we will replace the linktext with the keyword later on in the code //you can easily change links for each category here //(include class="ml-link" and linktext) link: 'linktext', }, ml: { keywords: [ //Add more keywords 'machine learning', 'Machine learning', 'Machine Learning', 'machine Learning', 'MACHINE LEARNING', ], //Change your article link (include class="ml-link" and linktext) link: 'linktext', }, ai: { keywords: [ 'artificial intelligence', 'Artificial intelligence', 'Artificial Intelligence', 'artificial Intelligence', 'ARTIFICIAL INTELLIGENCE', ], //Change your article link (include class="ml-link" and linktext) link: 'linktext', }, nl: { keywords: [ 'NLP', 'nlp', 'natural language processing', 'Natural Language Processing', 'NATURAL LANGUAGE PROCESSING', ], //Change your article link (include class="ml-link" and linktext) link: 'linktext', }, des: { keywords: [ 'data engineering services', 'Data Engineering Services', 'DATA ENGINEERING SERVICES', ], //Change your article link (include class="ml-link" and linktext) link: 'linktext', }, td: { keywords: [ 'training data', 'Training Data', 'training Data', 'TRAINING DATA', ], //Change your article link (include class="ml-link" and linktext) link: 'linktext', }, ias: { keywords: [ 'image annotation services', 'Image annotation services', 'image Annotation services', 'image annotation Services', 'Image Annotation Services', 'IMAGE ANNOTATION SERVICES', ], //Change your article link (include class="ml-link" and linktext) link: 'linktext', }, l: { keywords: [ 'labeling', 'labelling', ], //Change your article link (include class="ml-link" and linktext) link: 'linktext', }, pbp: { keywords: [ 'previous blog posts', 'previous blog post', 'latest', ], //Change your article link (include class="ml-link" and linktext) link: 'linktext', }, mlc: { keywords: [ 'machine learning course', 'machine learning class', ], //Change your article link (include class="ml-link" and linktext) link: 'linktext', }, }; //Articles to skip let articleIdsToSkip = ['post-2651', 'post-3414', 'post-3540']; //keyword with its related achortag is recieved here along with article id function searchAndReplace(keyword, anchorTag, articleId) { //selects the h3 h4 and p tags that are inside of the article let content = document.querySelector(`#${articleId} .entry-content`); //replaces the "linktext" in achor tag with the keyword that will be searched and replaced let newLink = anchorTag.replace('linktext', keyword); //regular expression to search keyword var re = new RegExp('(' + keyword + ')', 'g'); //this replaces the keywords in h3 h4 and p tags content with achor tag content.innerHTML = content.innerHTML.replace(re, newLink); } function articleFilter(keyword, anchorTag) { //gets all the articles var articles = document.querySelectorAll('article'); //if its zero or less then there are no articles if (articles.length > 0) { for (let x = 0; x < articles.length; x++) { //articles to skip is an array in which there are ids of articles which should not get effected //if the current article's id is also in that array then do not call search and replace with its data if (!articleIdsToSkip.includes(articles[x].id)) { //search and replace is called on articles which should get effected searchAndReplace(keyword, anchorTag, articles[x].id, key); } else { console.log( `Cannot replace the keywords in article with id ${articles[x].id}` ); } } } else { console.log('No articles found.'); } } let key; //not part of script, added for (key in keywordsAndLinks) { //key is the object in keywords and links object i.e ds, ml, ai for (let i = 0; i < keywordsAndLinks[key].keywords.length; i++) { //keywordsAndLinks[key].keywords is the array of keywords for key (ds, ml, ai) //keywordsAndLinks[key].keywords[i] is the keyword and keywordsAndLinks[key].link is the link //keyword and link is sent to searchreplace where it is then replaced using regular expression and replace function articleFilter( keywordsAndLinks[key].keywords[i], keywordsAndLinks[key].link ); } } function cleanLinks() { // (making smal functions is for DRY) this function gets the links and only keeps the first 2 and from the rest removes the anchor tag and replaces it with its text function removeLinks(links) { if (links.length > 1) { for (let i = 2; i < links.length; i++) { links[i].outerHTML = links[i].textContent; } } } //arrays which will contain all the achor tags found with the class (ds-link, ml-link, ailink) in each article inserted using search and replace let dslinks; let mllinks; let ailinks; let nllinks; let deslinks; let tdlinks; let iaslinks; let llinks; let pbplinks; let mlclinks; const content = document.querySelectorAll('article'); //all articles content.forEach((c) => { //to skip the articles with specific ids if (!articleIdsToSkip.includes(c.id)) { //getting all the anchor tags in each article one by one dslinks = document.querySelectorAll(`#${c.id} .entry-content a.ds-link`); mllinks = document.querySelectorAll(`#${c.id} .entry-content a.ml-link`); ailinks = document.querySelectorAll(`#${c.id} .entry-content a.ai-link`); nllinks = document.querySelectorAll(`#${c.id} .entry-content a.ntrl-link`); deslinks = document.querySelectorAll(`#${c.id} .entry-content a.des-link`); tdlinks = document.querySelectorAll(`#${c.id} .entry-content a.td-link`); iaslinks = document.querySelectorAll(`#${c.id} .entry-content a.ias-link`); mlclinks = document.querySelectorAll(`#${c.id} .entry-content a.mlc-link`); llinks = document.querySelectorAll(`#${c.id} .entry-content a.l-link`); pbplinks = document.querySelectorAll(`#${c.id} .entry-content a.pbp-link`); //sending the anchor tags list of each article one by one to remove extra anchor tags removeLinks(dslinks); removeLinks(mllinks); removeLinks(ailinks); removeLinks(nllinks); removeLinks(deslinks); removeLinks(tdlinks); removeLinks(iaslinks); removeLinks(mlclinks); removeLinks(llinks); removeLinks(pbplinks); } }); } //To remove extra achor tags of each category (ds, ml, ai) and only have 2 of each category per article cleanLinks(); */ //Recommended Articles var ctaLinks = [ /* ' ' + '

Subscribe to our AI newsletter!

' + */ '

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

'+ '

Towards AI has published Building LLMs for Production—our 470+ page guide to mastering LLMs with practical projects and expert insights!

' + '
' + '' + '' + '

Note: Content contains the views of the contributing authors and not Towards AI.
Disclosure: This website may contain sponsored content and affiliate links.

' + 'Discover Your Dream AI Career at Towards AI Jobs' + '

Towards AI has built a jobs board tailored specifically to Machine Learning and Data Science Jobs and Skills. Our software searches for live AI jobs each hour, labels and categorises them and makes them easily searchable. Explore over 10,000 live jobs today with Towards AI Jobs!

' + '
' + '

🔥 Recommended Articles 🔥

' + 'Why Become an LLM Developer? Launching Towards AI’s New One-Stop Conversion Course'+ 'Testing Launchpad.sh: A Container-based GPU Cloud for Inference and Fine-tuning'+ 'The Top 13 AI-Powered CRM Platforms
' + 'Top 11 AI Call Center Software for 2024
' + 'Learn Prompting 101—Prompt Engineering Course
' + 'Explore Leading Cloud Providers for GPU-Powered LLM Training
' + 'Best AI Communities for Artificial Intelligence Enthusiasts
' + 'Best Workstations for Deep Learning
' + 'Best Laptops for Deep Learning
' + 'Best Machine Learning Books
' + 'Machine Learning Algorithms
' + 'Neural Networks Tutorial
' + 'Best Public Datasets for Machine Learning
' + 'Neural Network Types
' + 'NLP Tutorial
' + 'Best Data Science Books
' + 'Monte Carlo Simulation Tutorial
' + 'Recommender System Tutorial
' + 'Linear Algebra for Deep Learning Tutorial
' + 'Google Colab Introduction
' + 'Decision Trees in Machine Learning
' + 'Principal Component Analysis (PCA) Tutorial
' + 'Linear Regression from Zero to Hero
'+ '

', /* + '

Join thousands of data leaders on the AI newsletter. It’s free, we don’t spam, and we never share your email address. Keep up to date with the latest work in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.

',*/ ]; var replaceText = { '': '', '': '', '
': '
' + ctaLinks + '
', }; Object.keys(replaceText).forEach((txtorig) => { //txtorig is the key in replacetext object const txtnew = replaceText[txtorig]; //txtnew is the value of the key in replacetext object let entryFooter = document.querySelector('article .entry-footer'); if (document.querySelectorAll('.single-post').length > 0) { //console.log('Article found.'); const text = entryFooter.innerHTML; entryFooter.innerHTML = text.replace(txtorig, txtnew); } else { // console.log('Article not found.'); //removing comment 09/04/24 } }); var css = document.createElement('style'); css.type = 'text/css'; css.innerHTML = '.post-tags { display:none !important } .article-cta a { font-size: 18px; }'; document.body.appendChild(css); //Extra //This function adds some accessibility needs to the site. function addAlly() { // In this function JQuery is replaced with vanilla javascript functions const imgCont = document.querySelector('.uw-imgcont'); imgCont.setAttribute('aria-label', 'AI news, latest developments'); imgCont.title = 'AI news, latest developments'; imgCont.rel = 'noopener'; document.querySelector('.page-mobile-menu-logo a').title = 'Towards AI Home'; document.querySelector('a.social-link').rel = 'noopener'; document.querySelector('a.uw-text').rel = 'noopener'; document.querySelector('a.uw-w-branding').rel = 'noopener'; document.querySelector('.blog h2.heading').innerHTML = 'Publication'; const popupSearch = document.querySelector$('a.btn-open-popup-search'); popupSearch.setAttribute('role', 'button'); popupSearch.title = 'Search'; const searchClose = document.querySelector('a.popup-search-close'); searchClose.setAttribute('role', 'button'); searchClose.title = 'Close search page'; // document // .querySelector('a.btn-open-popup-search') // .setAttribute( // 'href', // 'https://medium.com/towards-artificial-intelligence/search' // ); } // Add external attributes to 302 sticky and editorial links function extLink() { // Sticky 302 links, this fuction opens the link we send to Medium on a new tab and adds a "noopener" rel to them var stickyLinks = document.querySelectorAll('.grid-item.sticky a'); for (var i = 0; i < stickyLinks.length; i++) { /* stickyLinks[i].setAttribute('target', '_blank'); stickyLinks[i].setAttribute('rel', 'noopener'); */ } // Editorial 302 links, same here var editLinks = document.querySelectorAll( '.grid-item.category-editorial a' ); for (var i = 0; i < editLinks.length; i++) { editLinks[i].setAttribute('target', '_blank'); editLinks[i].setAttribute('rel', 'noopener'); } } // Add current year to copyright notices document.getElementById( 'js-current-year' ).textContent = new Date().getFullYear(); // Call functions after page load extLink(); //addAlly(); setTimeout(function() { //addAlly(); //ideally we should only need to run it once ↑ }, 5000); }; function closeCookieDialog (){ document.getElementById("cookie-consent").style.display = "none"; return false; } setTimeout ( function () { closeCookieDialog(); }, 15000); console.log(`%c 🚀🚀🚀 ███ █████ ███████ █████████ ███████████ █████████████ ███████████████ ███████ ███████ ███████ ┌───────────────────────────────────────────────────────────────────┐ │ │ │ Towards AI is looking for contributors! │ │ Join us in creating awesome AI content. │ │ Let's build the future of AI together → │ │ https://towardsai.net/contribute │ │ │ └───────────────────────────────────────────────────────────────────┘ `, `background: ; color: #00adff; font-size: large`); //Remove latest category across site document.querySelectorAll('a[rel="category tag"]').forEach(function(el) { if (el.textContent.trim() === 'Latest') { // Remove the two consecutive spaces (  ) if (el.nextSibling && el.nextSibling.nodeValue.includes('\u00A0\u00A0')) { el.nextSibling.nodeValue = ''; // Remove the spaces } el.style.display = 'none'; // Hide the element } }); // Add cross-domain measurement, anonymize IPs 'use strict'; //var ga = gtag; ga('config', 'G-9D3HKKFV1Q', 'auto', { /*'allowLinker': true,*/ 'anonymize_ip': true/*, 'linker': { 'domains': [ 'medium.com/towards-artificial-intelligence', 'datasets.towardsai.net', 'rss.towardsai.net', 'feed.towardsai.net', 'contribute.towardsai.net', 'members.towardsai.net', 'pub.towardsai.net', 'news.towardsai.net' ] } */ }); ga('send', 'pageview'); -->