Traditional software engineering dictates the use of modular and structured programming and top-down stepwise refinement techniques that reduce the amount of variability arising in the development process by establishing standard procedures to be followed while writing software. This focusing leads to reduced variability in the resulting products, due to the use of standardized constructs. Genetic programming (GP) performs heuristic search in the space of programs. Programs produced through the GP paradigm emerge as the result of simulated evolution and are built through a bottom-up process, incrementally augmenting their functionality until a satisfactory level of performance is reached. Can we automatically extract knowledge from the GP programming process that can be useful to focus the search and reduce product variability, thus leading to a more effective use of the available resources? An answer to this question is investigated with the aid of cultural algorithms. A new system, cultural algorithms with genetic programming (CAGP), is presented. The system has two levels. The first is the pool of genetic programs (population level), and the second is a knowledge repository (belief set) that is built during the GP run and is used to guide the search process. The microevolution within the population brings about potentially meaningful characteristics of the programs for the achievement of the given task, such as properties exhibited by the best performers in the population. CAGP extracts these features and represents them as the set of the current beliefs. Beliefs correspond to constraints that all the genetic operators and programs must follow. Interaction between the two levels occurs in one direction through the extraction process and, in the other, through the modulation of an individual's program parameters according to which, and how many, of the constraints it follows. CAGP is applied to solve an instance of the symbolic regression problem, in which a function of one variable needs to be discovered. The results of the experiments show an overall improvement on the average performance of CAGP over GP alone and a significant reduction of the complexity of the produced solution. Moreover, the execution time required by CAGP is comparable with the time required by GP alone.