Effects of technological change and automation on industry structure and (wage-)inequality: insights from a dynamic task-based model

The advent of artificial intelligence is changing the task allocation of workers and machines in firms’ production processes with potentially wide ranging effects on workers and firms. We develop an agent-based simulation framework to investigate the consequences of different types of automation for industry output, the wage distribution, the labor share, and industry dynamics. It is shown how the competitiveness of markets, in particular barriers to entry, changes the effects that automation has on various outcome variables, and to which extent heterogeneous workers with distinct general skill endowments and heterogeneous firms featuring distinct wage offer rules affect the channels via which automation changes market outcomes.

uncertain consequences. Radical transformation of the workplaces (Brynjolfsson and McAfee 2011;Ford 2015) may lead to the displacement of large fractions of the workforce as tasks will increasingly be done by intelligent machines (Frey and Osborne 2017). This is one projection of what to expect. Another perspective emphasizes that also this transformation will bring prosperity as it was the case with technological advancements in the past. Among the countervailing forces to the displacement of workers, it has been put forward that automation might augment tasks carried out by workers, thereby increasing their productivity, that total productivity increases may lead to higher aggregate demand thus increasing labor demand, and that it may create new jobs as tasks will emerge that did not exist in the past Restrepo 2018b, 2019a;Autor and Salomons 2018;Vivarelli 2014).
In this paper, we aim to shed more light on the consequences of automation for economies paying particular attention to the distributional effects of automation. We do this by building a dynamic industry model with task-based production on the firm level where firms decide on whether to allocate workers or machines to different tasks. Firms compete both on the product and the labor market. We are interested in how the allocation decisions of firms change in the presence of different forms of automation. In particular, we consider four different types of automation: deepening of automation which affects the productivity of machines, labor augmenting technological changes which affect the productivity of workers, automation that affects both capital and labor, and a shift in the set of tasks that constitute the production function. A central feature of our analysis is that we analyze the consequences of these various forms of automation on the distribution of wages between and within firms, and on the functional income distribution. An important aspect of our analysis is that we explore how the effects of automation depends on the competitiveness of the industry. We distinguish between industries in which high barriers to entry prevent the entry of additional competitors and industries without entry barriers where recurrent entry and exit, triggered by positive respectively negative firm profits, occurs. We examine to which extent and why the competitiveness of markets alters the distributional effects of automation. Moreover, we analyze the role of heterogeneous as opposed to homogeneous agents. We compare the outcomes of automation when workers have homogeneous skills to the outcomes we get with high skill and low skill workers. In addition, we explore a version of our model with two types of firms. One set of firms has high wage setting power, and another set of firms has low wage setting power.
Our analysis, paying particular attention to the distributional consequences in the light of potential market entry and exit of firms, extends existing analyses of the economic effects of automation. Our investigation borrows from task-based models studying the consequences of automation for labor markets and the macroeconomy (Acemoglu and Autor 2011;Acemoglu and Restrepo 2018a;2019a). Also the distinction between different types of automation addressed in our analysis builds on this stream of literature, which emphasizes the countervailing forces that different changes in productivity have, in particular, on labor demand. A recurring theme here is that, on the one hand side, automation reduces the amount of labor as more tasks are done by machines. On the other hand, as capital can perform tasks more cheaply, productions costs of firms decrease making them more productive. To the extent that firms expand due to the productivity effect, labor demand will increase, and more so when automation is accompanied with the creation of new tasks. Which of the two effects dominates will determine how employment and earnings are affected. Related to the productivity effect in this strand of the literature is also an observation that automation that comes with low productivity effects, which Acemoglu and Restrepo (2019b) call "so-so technologies", will likely be detrimental to workers. While the economic mechanisms driving the results of our analysis are also related to different types of automation and their effect on the productivity of firms, we consider a dynamic industry framework, where the task allocation decisions are made on the firm level rather than on a macroeconomic level. This allows us to incorporate competition effects and to more closely pay attention to industry dynamics and the role that heterogeneous workers and firms may play with respect to the economic consequences of automation.
We rely in our analysis on an agent-based modeling approach, which has become a widely used approach for studying issues related to innovation and industrial dynamics from an evolutionary perspective, see, e.g. Nelson and Winter (1982), Dosi et al. (1995), Landini et al. (2017), and Dawid et al. (2019), or the survey in Dawid (2006), as well as in labor economics (Neugart and Richiardi 2018), and macroeconomics (Dawid and Delli Gatti 2018;Dosi and Roventini 2019). Several recent contributions have studied different implications of automation using an agent-based approach. Vermeulen et al. (2020) investigate an agent-based model with multiple sectors and occupations. They explore the effect of productivity increases and the creation of new sectors on employment and wages, and various policies to mitigate the negative consequences of automation on workers. They find that robotization causes the stagnation of wages as there is less wage competition across sectors. Robotization, however, also leads to the emergence of new sectors where labor shortage leads to price-wage spirals pushing up wages. Fierro et al. (2022) also base their analysis on a multi-sector model. Workers have heterogeneous skills and firms post vacancies requiring different skills due to an endogenous skill-biased technological change. They show that automation leads to job polarization, and how a minimum wage policy may increase aggregate productivity. Job polarization is driven by automation that mainly affects manufacturing and triggers the emergence of high skill and low skill occupations in the service sector, and reduces the number of occupations requiring medium skills. Central to this result are stronger consumption preferences for personal services of the high skill workers, who profit from automation, compared to the rest of the population. Dosi et al. (2022) extend the well established K+S agent-based macroeconomic framework to a multi-sector setting with endogenous occurrence of technological paradigms to study the employment effects of automation. It is shown how aggregate income balances labor creation and destruction to avoid persistent technological unemployment. The findings, in particular with respect to technological unemployment, are the result of new technologies leading to the destruction of sectors as well as the emergence of new sectors. Product innovation affects aggregate demand via consumption rules that are linked to the emergence of products that households have a preference for. Depending on their income consumers allocate their income to basic goods or luxury goods. Overall, it is shown how a resilient economy can absorb technological shocks by avoiding negative feedback loops that affect the labor market and the income distribution by fostering the pass-through of productivity growth to wage growth. Bertani et al. (2020Bertani et al. ( , 2021 incorporate digital assets, which are produced in a separate sector and increase productivity of consumption good producers into an agent-based macroeconomic model. They show that in such a setting technological unemployment emerges in the long run. The productivity effect of the digital assets leads to a reduction in employment in the production sector that cannot be compensated by new jobs created in the digital sector. More generally, effects of (rapid) technological change on the wage distribution have been studied in numerous agent-based settings, see e.g. Dosi et al. (2017), , Caiani et al. (2019), and Dawid and Hepp (2021).
In contrast to these agent-based studies, our approach features market entry and exit of firms, and various forms of automation that we compare. Moreover, using a task-based approach, we are able to speak to the effects of automation on the wage distribution disentangling the effects on between firm and within firm wage effects. Within our framework, these wage effects can be traced to the firms' decisions on how to allocate machines and workers on tasks, and the firms' decision to enter or leave the market as a consequence of automation that changes profits to be earned.
In this respect, our theoretical analysis also relates to empirical studies that explore the consequences of automation on the firm level. Due to data limitations this is still a small literature, that, however, has already interesting insights to offer. 1 Barth et al. (2020) shows that robots have positive effects on average wages, and that wages of high skill workers increase relative to wages of the low skill workers in firms that robotize. Dixon et al. (2021) find that investment in robots increases total employment within firms, which, in their sample of Canadian firms, is a composite effect of higher employment of high skill workers and of low skill workers, and lower employment of middle skill workers. In contrast, Koch et al. (2021), based on Spanish data, find that employment in firms adopting robots increases for all skill groups. Moreover, they show that the labor cost share in firms adopting robots decreases. Domini et al. (2021) document that the channel through which automation raises firms' employment growth rate is through a higher hiring rate and a lower separation rate. Interestingly, they also show that automation spikes are not associated with changes in the occupational composition of firms or changes in jobs that can be characterized as routine or non-routine. In a follow-up paper, Domini et al. (2022) again use French firm-level data to explore the effect of automation on within and between firm wage inequality. They find that the largest part of the wage inequality within each sector is due to within firm inequality and that automation spikes have hardly any impact on this inequality.
Our task-based theoretical analysis with heterogeneous worker skills offers economic mechanisms that may help to better understand the empirical effects of automation on the firm level. In particular, we can demonstrate how automation changes the task allocation of firms that produce by combining different tasks, where lower ranked tasks are more likely run by machines and higher ranked tasks are more likely done by workers. This is accompanied by changing wages paid to high skill and low skill workers driven by changes in the productivity of tasks and by changes in the composition of workers doing specific tasks. Moreover, we can show how high skill workers may crowd out low skill workers on lower tasks, or in some instances may withdraw from lower tasks and rather apply for higher tasks as new firms enter the market due to better profit opportunities caused by automation.
We proceed by introducing our task-based simulation framework in Section 2. In Section 3, we parameterize our model and introduce the experiments. Section 4 discusses the results, and Section 5 concludes.

General setting and task-based production
We consider an industry in which m t firms offer a homogeneous consumption good. Denoting by Y i,t the output of firm i ∈ {1, ..., m t } at time t, the price of the good at t is given by the iso-elastic inverse demand curve Here B t is the total consumption budget of all consumers in this industry, consisting of the last period's industry profits and labor and capital income. We abstract from savings by firms and households and assume that all firm profits are fully channeled back to households. Hence, the total consumption budget (in nominal terms) is constant over time, i.e. B t = B ∀t. Holding the consumption budget constant allows us to focus on the supply side effects of different types of automation (and shuts off demand side channels associated with automation studied, e.g., by Fierro et al. (2022) or Dosi et al. (2022)). Following an approach similar to Acemoglu and Autor (2011); Restrepo (2018a, b, 2019a), we also assume that different tasks have to be carried out in order to produce the consumption good. More precisely, X t = {N t − n + 1, ..., N t } denotes the set of tasks at time t, and at each time period each firm has to allocate either a machine or a worker to each task x ∈ X t . There is a constant population of J workers who aim to work in this industry. Workers can have high and low general skills and each worker's general skill level is exogenously given and constant over time. Only workers with high general skills can be allocated to any task, whereas workers with low general skills can never carry out a task above a level x max , and hence firms also cannot allocate such workers to a task x > x max . Moreover, workers are characterized by a specific skill level s j,t , which adapts over time t as a worker j is allocated to specific tasks. Intuitively, the general skill level represents the level of formal education of the worker and the specific skill the worker's productivity at a given task, which might increase due to on-the-job learning. The function l i,t (x) ∈ {0, 1, .., J } denotes whether a machine (l i,t (x) = 0) or a worker (l i,t (x) = j ∈ {1, .., J }) carries out task x ∈ X t at firm i in period t. The output of task x at firm i is denoted by y i,t (x) and is given by where 1 [.] denotes the indicator function. Hence, the output of task x is given by γ L (min(x, s j,t )) if task x is filled with worker j and by γ M (x) if task x is filled with a machine. The functions γ L (.), γ M (.) are assumed to be increasing, which means that workers and machines generate more output when allocated to a higher task. The fact that for tasks carried out by workers the argument of γ L (.) is the minimum of the task level x and the specific skill of the worker (s j,t ), captures that workers lacking the necessary skills cannot fully fulfill a high level task. Finally, in accordance with Acemoglu and Autor (2011) we assume that the productivity of (sufficiently skilled) workers relative to machines is larger for high level compared to low level tasks. Formally, this means that the ratio γ L (x)/γ M (x) increases with x. 2 Output of firm i is given by the production function Thus, in line with existing models of tasks based production in the literature (e.g. Restrepo 2018b, 2020b), the production process incorporates complementarity between tasks, whereas there is substitutability of labor and machines on each task. Workers increase their specific skills at the end of each period in which they have been allocated to a task above their current specific skills. More precisely, we assume that the specific skills of a worker move up by one task in each period in which the worker is assigned to a task above the value of her current specific skills. Hence, where x j,t denotes the tasks to which workerj was allocated in period t.
We analyze the consequences of four different types of automation for market outcomes, by changing the parametersγ k with k = L, M, to explore deepening of automation, labor augmenting technological advances, or both, and shifting tasks from X t = {N t − n + 1, ..., N t } toX t = {N t − n + 2, ..., N t + 1}. There are numerous examples justifying the study of these types of automation (c.f. Acemoglu and Restrepo 2019a). Historically old machines have been replaced with newer vintages that are more productive. In agriculture plows have been replaced by more modern technology where modern technology makes use of global positioning systems for harvesting, or numerically controlled milling machines and lathes have been replaced by CNC (computer numerical control) machines. Another example is the widespread introduction of industrial robots that at some point were able to do assembling tasks, to weld, or to do quality control thereby automating labor intensive tasks. Even in the service industry, various tasks have been automated by artificial intelligence (AI) powered technologies that are able to do tax declarations, diagnose diseases, or write reports. These are all examples for the deepening of automation, i.e. an increase in γ M . Latest technological developments that have led to increases inγ L , i.e. labor augmenting technological advances are augmented reality glasses for the design of new products, exo-skeletons that support workers in executing manual tasks, applications that collect information to make health care workers more effective, or software that makes teaching to heterogeneous students more effective. New tasks or occupations that emerged with more powerful AI are those, for example, related to installing or maintaining these systems. AI systems need to be trained, output of AI systems needs to be explained to the users, and the performance of these systems needs to be monitored. Our model-based analysis tries to shed light on all these technical changes in a comparative way and what effect they have on market outcomes.

Determination of labor demand and labor market interactions
In every period, each firm develops a plan for the allocation of the different tasks to workers respectively machines. More precisely, each firm calculates for each task x ∈ X t the expected profitπx ,t arising if all tasks belowx are filled with machines and starting with taskx all higher tasks are allocated to workers. This calculation is based on naive expectations about the consumption good and machine prices as well as about wages. Denoting by p m,t the machine price in period t and byw x,t the economy wide average wage of workers allocated to task x in t, the estimated profit can be written aŝ The firm then determines the lowest task it plans to allocate to a worker as x * i,t = arg max N t −n+1≤x≤N tπx ,t . If the firm in its current workforce has workers allocated to tasks below x * i,t it dismisses these workers. Afterwards, it posts vacancies for all tasks x ≥ x * i,t which are currently not filled with workers. Vacancies are posted stating the level of the task for the advertised position.
The labor market follows a simple search and matching protocol without on-thejob search. Once all vacancies have been posted, every unemployed worker j applies to ξ posted vacancies. If for at least ξ posted vacancies the worker's specific skills exceed the skill requirement of the task (i.e. s j,t ≥ x if the posted vacancy is for task x) the worker applies to ξ randomly chosen vacancies among those. Otherwise, the worker applies to all posted vacancies for which she has sufficient specific skills and chooses the additional positions to apply to randomly among the opening for which she has in-sufficient specific skills. Workers with low general skills, however, never apply to openings for tasks above x max .
Firms enter negotiations with all applicants for its posted vacancies and for each applicant elicits information about her specific skill level s j,t and her reservation wage w res j,t . Based on this, the firm develops a plan for making job offers. As a first step, for each task to be filled the firm calculates the maximal wage it can pay for a worker with sufficient skills for this task such that the resulting firm profit is still higher compared to a scenario where this task is filled by a machine. This calculation is carried out under naive expectations about the machine price and the assumption that apart from this considered task all tasks below x * i,t are allocated to machines and all above x * i,t to workers. This gives rise to a maximal wage w max i,t (x) the firm is willing to pay for task x. Then, starting from the highest task to be filled, for each open task x the firm determines the set of yet not allocated applicants who have sufficient specific skills for the considered task (s j,t ≥ x) and at the same time a reservation wage below the firm's maximal willingness to pay (w res j,t ≤ w max i,t (x)). From this set of applicants the firm chooses the worker with the highest reservation wage and allocates it to task x. The rationale for this first step in the procedure is that the firm tries to make sure that it can fill as many positions out of the pool of applicants as possible. In contrast, if the firm would allocate a worker with a relatively low reservation wage to that task, another worker in the pool of applicants with a higher reservation wage would be allocated to a lower task. This worker would then be offered a lower wage because of the lower productivity of that task, and that wage offer might be below the worker's reservation wage. Consequently, the firm would run the risk of not being able to fill the lower task with a worker. Thus, since the maximal wage the firm is willing to pay increases with x, potential frictions arising from a mismatch between w max i,t (x) and w res j,t are minimized if workers with high reservation wages are allocated to high tasks.
After each open task has been treated in this way, the firm determines the set of all open tasks to which so far no applicant has been allocated. If this set is non-empty then, starting with the highest among these tasks, for each task x the firm selects among the currently unassigned applicants the one with the highest specific skills and allocates her to task x.
After a temporary allocation of applicants has been generated in this way, as a final planning step, the firm goes again through all tasks that it wants to fill with workers and checks whether there are non-allocated applicants whose specific skills are above the level of the task and whose reservation wage is lower than that of the currently allocated applicant. If such a case occurs, the applicant with the higher reservation wage is replaced by that with the lower reservation wage. Since the wage a worker receives depends positively on the worker's reservations wage (see below), this final step reduces the expected wage bill of the firm without increasing the frictions, i.e. reducing the probability of a worker accepting the offer of the firm. The procedure results in a planned allocationl For every task x withl i,t (x) > 0 the firm makes a job offer with wage to the applicant j =l i,t (x) ∈ {1, .., J }. The parameter ζ i indicates the fraction of the jointly generated surplus the firm intends to keep rather than to transfer to the worker. If a worker receives several job offers, she accepts the one with the highest wage offer and rejects all other offers. If the job offer of firm i for task x has been accepted, we have l i,t =l i,t (x),otherwise l i,t = 0. Once all applicants have accepted/rejected their offers the labor market closes. All applicants who did not receive job offers remain unemployed in period t and receive unemployment benefits b ue . 3 Workers update their reservation wage for t + 1 as a weighted average between their reservation wage and their wage (or unemployment) income in t: ., m t , ∀x ∈ X t } is the set of unemployed workers at t.

Capital and consumption goods markets, firm profits
In the previous section, we described the planning process of the firm. This process results in a plan determining which task the firm wants to offer to a worker and which task it wants to fill with a machine. A task that a firm intends to fill with a worker may, however, not be allocated to a worker because there might have been no applications of workers, or the worker which received an offer for that task decided to accept a better offer at another firm. We assume, that all the tasks which firm i has not filled with workers after the closure of the labor market are allocated to machines. Hence, the demand for machines by firm i in period t is given by all the tasks that the firm did not plan to allocate to a worker in the first place and the tasks it wanted to allocate to a worker but could not fill with a worker due to frictions, i.e.
To abstract from issues of inter-temporal investment planning, we assume that firms rent the required machines every period. There is a competitive rental market for machines with an upward sloping supply curve such that the rental price is where η, κ > 0 are parameters. Since the firm is never rationed on the capital market either a worker or a machine is allocated to each task. Based on the resulting allocation l i,t the firm's output Y i,t is determined by Eqs. 2 and 3 and the price of the consumption good p t is given by the inverse demand curve (1). The actual profit of firm i in period t then reads At the end of period t there is a random separation of matches between workers and firms. More precisely, every worker leaves her current firm and becomes unemployed with probability α > 0. The worker then applies for new jobs in t + 1 and the firm enters the planning for t + 1 with the corresponding task not filled.

Firm exit and entry
In what follows, we will consider the effects of different types of automation both in scenarios where entry barriers to the industry are so high that even in cases of positive profits of firms in the industry there is no entry. For this scenario, we consider parametrizations where firm profits are always positive and, therefore, there is also no exit, i.e. m t = m 0 for all t. Additionally, we consider scenarios with entry and exit, where we use a reduced form representation of the entry and exit process. More precisely, denoting by π t = m t π i,t m t the average profit of all firms in period t, we assume that in periods with positive average profits, i.e. π t > 0, an additional firm enters the industry at the beginning of period t + 1 with probability P en = π t β en +π t , where β en is a parameter, which is positively related to the barriers of entry in the industry. In periods with π t < 0 there is no entry, but with probability P = |π t | β ex +|π t | a randomly selected firm among those with π i,t < 0 exits the industry. 4

Sequence of events
The following list provides an overview over the different steps and their sequence carried out in every period: 1. Exit and entry of firms (in the exit/entry scenario) 2. Firms carry out their production planning, decide which tasks should be allocated to machines/workers and determine labor demand 3. Firms dismiss excess workers 4. Firms post vacancies 5. Unemployed workers apply to vacancies 6. Firms generate allocation of applicants to open tasks and make wage offers to selected applicants 7. Applicants accept highest wage offer 8. Firms determine their demand for machines and acquire machines at the market clearing rental price 9. Firms produce and sell consumption goods 10. Firm profits are determined 11. Workers update their specific skills and reservation wages 12. Random quitting of workers from their employers

Parameters
To calibrate our model, we follow a mixed approach where we, when possible, recur to empirical evidence for specific parameter choices, or choose parameters to replicate macroeconomic indicators. See Table 1 for an overview of the parameters and initial values. We populate our model with 300 workers. The task range encompasses 11 tasks. We interpret an iteration as one quarter of a year. Choosing a quitting rate of 2.5% then would lead to an average job tenure of about 10 years (if firms were not to dismiss workers for economic reasons), which matches what Auer and Cazes (2000) report for a sample of OECD countries. Studies on earnings losses of displaced workers after reemployment suggest that these workers earn 4% to 25% less (cf. Bartel and Borjas 1981;Ruhm 1987;Burda and Mertens 2001). We use these estimates to set our parameter on the reservation wage update by calculating how high it would have to be so that a displaced worker would earn approximately 10% less after an unemployment spell of four iterations when being reemployed. Parameters for labor productivity and machine productivity and for the supply function of machines are chosen to get a task allocation with workers and machines that brings us to an empirically plausible labor share of about 60%. The parameters guiding entry and exit of firms is set on a level so that it roughly takes 10 years to erase market profits through entry of new firms -starting from a number of firms (25) that implies mark-ups, calculated as the ratio of total profits in the economy to sales, in the range of 20%. 5 Mark-ups of this size have been reported, for example, by Bresnahan (1989).
To run the model, we also need to initialize the price level of the machines p m 0 , the workers' reservation wage w res j,0 , and the number of firms m 0 . We choose initializations p m 0 = 0.8, w res j,0 = 5, and m 0 = 25. During the simulation the price of machines then is determined endogenously by Eq. 6, workers' reservation wages adjust according to Eq. 5, and, depending on whether we simulate the model with market entry and exit or not, the number of firms stays constant or is driven by the entry and exit probabilities for firms described in Section 2.4.

Experiments
Within our framework, we conduct four different experiments related to different types of automation, see Table 2 for a summary. These stylized experiments are meant to capture distinct dimensions of automation in a task-based framework (see also Acemoglu and Restrepo 2019a). Experiment (1) analyzes the effect of "deepening of automation". It relates to an increase in the productivity of machines with which 5 Our parametrization implies that at least for the initial number of firms the supply of workers always exceeds labor demand such that rationing of firms on the labor market is entirely due to frictions. We choose this setup to rule out that task reallocation effects of changes in labor respectively machine productivity are crucially affected by labor shortage. tasks can be operated. We operationalize the experiment by increasing parameter γ m so that the productivity of tasks increases by 2% on average. Experiment (2) captures "labor augmenting technological advances". These are technologies that increase a worker's output on a task. These labor augmenting technological advances correspond to an increase in the productivity of tasks that are operated with workers and are expressed in the framework of our model as an increase in γ l . To make the effects of Experiment (2) comparable to that of Experiment (1), the size of the increase in γ l is chosen so that the productivity of tasks increases by 2% on average. Experiment (3) is a combination of both changes in automation conducted in Experiments (1) and (2). Finally, Experiment (4) analyzes a "shift in tasks". This allows us to capture technological advances leading to the creation of new tasks. In our experiment, we add one more task that has a higher productivity than the tasks that existed so far.
To keep the number of tasks constant, the hitherto lowest task, i.e. the one with the lowest machine or labor productivity disappears. Due to the discrete number of tasks, the shift in tasks could not be calibrated in a way that also Experiment (4) yields an average productivity increase of 2% across tasks. Hence, the effects arising in Experiment (4) can only be compared in a qualitative way with those of Experiments (1) and (2).

Dynamics of the burn in phase
Choosing initial values for the variables of our model and parameters, as summarized in Table 1, without any technological change results in stationary outcomes, as exemplified in Fig. 1. The time series shown for various variables relate to the case where we allow for entry and exit of firms and initialize the model with 25 firms (which is the number of firms we keep constant for the case of no exit and entry of firms.) Initially, profits summarized over all firms in the market are positive, triggering firm entry. As the total number of firms settles at 39, total profits in the market become zero. The entry of firms initially drives up real output, which however eventually converges to a stationary level as the number of firms ceases to grow further. Firms partly produce with labor and partly with machines. Lower tasks are operated with machines as exemplified with the share of firms putting workers on Task 15, which becomes zero after a short burn in phase. Task 16, in contrast, is operated by almost all firms with workers. Hence, our model endogenously, based on independent decisions by the different firms, generates a rather sharp distinction between tasks that are carried out by machines and by workers. In the long run, firms allocate a fraction 45% of tasks to workers and the labor share in the industry settles at approximately 62%. Throughout our analysis, we use the Theil index as a measure of wage inequality, as it will allow us to easily decompose the overall wage inequality into the components of a within firm wage inequality and a between firm wage inequality. As can be seen in Fig. 1, the Theil index also converges to a stationary level, and most of the wage inequality can be attributed to within firm wage inequality.

Long-run effects
The main focus of our analysis is on the longer run effects of automation on various market outcomes. To analyze these effects, we shock the economy at iteration 400 and record outcomes briefly before the shock and 100 iterations after the shock. The results are summarized in box plots, where the coding on the vertical axis relates to the baseline (0), i.e. outcomes before the shock, and the experiments "deepening of   automation" (1), "labor augmenting technological advances" (2), the combination of the two (3), and "shifts in tasks" (4). The box plots summarize the outcomes of 50 replications showing the 25th, 50th, and 75th percentile, and the upper and lower adjacent values. Dots refer to outside values.
In particular, we analyze the consequences arising from the various forms of automation for the labor share, real wages, employment, and the wage distribution. We compare the distributional effects when barriers to entry are so high that there is no entry and exit of firms in the market and when entry barriers are low such that there is entry and exit of firms in the market. These are two extreme forms of the competitiveness of industries that may, and as we will see, do matter for how automation affects market outcomes. Moreover, our model allows us to analyze the effects of automation on market outcomes along two further dimensions. First, in the model without entry and exit of firms, we introduce firm heterogeneity with respect to their wage setting behavior, cf. parameter ζ i in our model description. Rather than assuming that all firms have the same wage offer rule, we split firms randomly into one half that wants to keep a larger fraction of the joined surplus rather than transferring it to the workers, and another half that transfers a larger fraction of the joined surplus to the workers via the wage offer. Second, we analyze the outcome of our experiments for scenarios where workers have different general skills. In this scenario, as opposed to our baseline where all workers can acquire necessary specific skills for all tasks, there are high skill workers who can be employed on all tasks of a firm, and low skill workers who can only be assigned to tasks up to x max and do not have the general skills needed to operate higher tasks.

No market entry or exit
Homogeneous firms We start discussing our results by considering the scenario with no entry and exit of firms and homogeneous agents. Figure 2 summarizes the main findings. With all four forms of automation real output in the economy increases. However, the distributional consequences differ substantially. With respect to the baseline of no automation, we observe that a deepening of automation (Experiment (1)) decreases the labor share and labor augmenting technological advances (Experiment (2)) increase the labor share. If both types of automation occur simultaneously (Experiment (3)) the effects on the labor share more or less compensate each other, whereas a shift in tasks (Experiment (4)) raises the labor share. The signs of the effects of the four experiments on the fraction of tasks allocated to workers are equal to the signs of the effects on the labor share. We can also see that automation has distinct effects on the total profits in the industry. Compared to the baseline, automation deepening, i.e. higher machine productivity, increases total profits, whereas labor augmenting technological change, i.e. higher labor productivity, decreases total profits. When productivity rises for both production factors, total profits stay approximately the same, while they decrease with a shift in tasks. The wage distribution, measured with the Theil index, becomes more equal for a deepening of automation and becomes more unequal for higher labor productivities. The effects of automation on the wage distribution are almost exclusively related to a change in the within firm wage inequality and not to a change in the between firm wage inequality as   The observation that real output increases in all four experiments is a straightforward consequence of the higher task productivities. Less obvious are the observations that the positive output effect is much stronger for labor augmenting technological advances compared to automation deepening (although our experiments are set up in a way that the average productivity increase on each task is the same in Experiments (1) and (2)), and that only automation deepening leads to an increase in firm profits, whereas an increase in labor productivity results in lower profits compared to the baseline. To gain an intuitive understanding of these observations, it should be noted that the decision whether a task is (planned to be) allocated to a machine or a worker is essentially based on the ratio between productivity and costs (i.e. machine price respectively expected wage) for the two options. For tasks close to the marginal task, where the allocation switches from machines to workers, this ratio is approximately identical under both allocations, but both productivity and costs are lower for a machine compared to a worker allocation. If machine productivity increases and hence firms re-allocate one (or several) tasks from workers to machines this reallocation implies a decrease in output (due to the lower productivity of machines) and in firm costs. In contrast, in the case of an increase of labor productivity the induced reallocation of tasks to workers induces a further increase of output (in addition to the increases triggered by the pure effect of a productivity increase) and at the same time an increase in costs. Hence, total output increase is larger under labor augmenting technological advances compared to automation deepening. The implications for firm profits are then driven by the resulting price effect. The stronger increase in output under labor augmenting technological change induces a stronger decrease in the price of the consumption good. Since at the same time the costs of the firms increase this induces a reduction in profits. In contrast, under automation deepening the reallocation of tasks to machines has a positive impact on the consumption good price and therefore induces an increase of firm profits. 6 The effects on the average real wages in the industry are the result of countervailing forces. As described above, a higher machine productivity reduces the average real wage. As firms substitute labor for machine, labor demand declines which exerts downward pressure on wages (labor demand effect). At the same time average real wages (net of a demand effect) increase because only those workers operating better paid higher tasks remain employed (composition effect). As workers are spread over fewer tasks also wage inequality declines. For a higher labor productivity the composition effect and the labor demand effect have opposite signs when compared to the experiment with a higher machine productivity. Labor demand increases pushing up wages. At the same time workers are spread over a larger set of tasks including less well paid tasks, which reduces average wages (net of the labor demand effect). As the labor demand effect is far stronger than the composition effect, real wages increase. Moreover, wage inequality increases as workers operate less well paying tasks that formerly have been done by machines.
Heterogeneous wage bargaining So far we have shown the consequences of various forms of automation when firms are homogeneous with respect to how wages are determined. We proceed by altering our assumption on wage setting to investigate whether heterogeneity of firms in this respect changes the obtained results. We randomly divide the population of firms into two groups. Half of the firms have a wage setting parameter of ζ i = 0.25, whereas the remaining firms have ζ i = 0.75. In the former case, firms on average offer higher wages compared to the latter case, see Eq. 5.
Compared to the case with homogeneous firms, we observe that total real output, employment, and the labor share are hardly affected by heterogeneous wage setting rules across firms (see Fig. 3). Since half of the firms pay lower wages than the rest of the firms, these firms with lower wage costs make significantly higher profits. Average real wages are only slightly affected by the heterogeneous population of firms compared to a homogeneous population. As to be expected, the share of wage inequality (measured again by the Theil index) attributable to the between firm wage inequality increases substantially. How automation affects wage inequality and the share of within firm wage inequality in relation to total inequality is, however, unaffected by introducing heterogeneous firms.
Heterogeneous general skills of workers Next, we consider the effect of heterogeneity on the worker side. More precisely, we assume that workers have heterogeneous general skills (and firms are homogeneous again). As explained in Section 2.1, workers with high general skills can carry out and acquire the necessary specific skills for all task, whereas workers with low skills can only carry out tasks up to level x max . In our experiment, the share of high skill workers is 30% and we set x max = 18, where the highest possible task is N t = 20 in Experiments (1) -(3) and N t = 21 for t ≥ 400 in Experiment (4).
The effects of automation with heterogeneous general skills on output, tasks assigned to workers, labor share, total profits, average real wages, and wage inequality are almost unchanged (figures are not shown) when compared to the case of homogeneous skills. However, the two skill groups are differently affected by automation. This becomes evident as we look into wages and employment by skill group (Fig. 4). As to be expected, the wages of the high skill workers relative to the low skill workers are always higher and so are relative employment rates. Different types of automation, however, affect these ratios differently.
Automation deepening, i.e. an increase in machine productivity decreases the wage ratio of the high skill workers relative to the low skill workers, while increasing the relative employment rate. This is because the reallocation of tasks to machines triggered by automation deepening mainly affects relatively low tasks. While employment decreases for both skill groups, the employment effect is stronger for the low skill workers for whom fewer tasks exist to apply for. Workers with high general skills are also less employed, but the effect on their employment level is substantially smaller since only a fraction of high skill workers is allocated to low level tasks. Due to a composition effect, the average wage of the employed low skill workers increases relative to that of the high skill workers, where, like in the baseline, all wages decrease in real terms.
Higher labor productivity, due to labor augmenting technological advances, triggers exactly the opposite effects, since here tasks are reallocated from machines to workers. Both types of workers gain from higher labor productivity which translates into higher wages. For the low skill workers, however, as more tasks are done by workers, average wages do not increase by so much. This composition effect is almost absent for the high skill workers as they are still running the higher tasks. Hence the ratio of average wages of high skill and low skill workers increases. For a better understanding of the effect on the relative employment rate, we can disentangle the high skill workers' employment into employment on high tasks and low tasks (not shown in figures). What we observe is that high skill workers' employment on high tasks stays fairly constant. High skill workers' and low skill workers' employment on lower tasks increases with higher labor productivity. So both groups gain in terms of employment, but low skill workers gain more so that the relative employment rate decreases.
For automation relating to higher labor and machine productivity, i.e. Experiment (3), the two effects almost cancel out. For a shift in tasks, the mechanisms described in relation to the experiment on a higher labor productivity are prevailing. There are more tasks at the upper part of the task range which are done by high skill workers. Some of these high skill workers were assigned to lower tasks before. Thus employment of the high skill workers hardly changes, and employment of the low skill workers increases as there is less competition from high skill workers for the lower tasks.

Market entry and exit
Homogeneous workers We turn to a discussion of our results for the scenario with entry and exit of firms and homogeneous agents now. These results are summarized in Fig. 5. Compared to an industry with high barriers to entry for new firms, see the results in Fig. 2, we observe that in the baseline (without technology shocks) the labor share is higher, fewer tasks are allocated to workers, total output is higher, real wages are higher, and wage inequality is reduced.
Without entry barriers the positive firm profits, which arise under the initial (and fixed) number of firms (this is the same number of firms present in the runs underlying Fig. 2) triggers entry by additional firms. This increases the production capacity and total output in the industry compared to the scenario without entry and exit. The new firms demand labor and thereby push up total employment and at the same time the consumption good price decreases due to higher total output. Together this drives up real wages. Since labor becomes relatively more expensive the average number of tasks in a firm carried out by workers goes down. The wage effect dominates leading to a higher labor share in the scenario with exit and entry. As expected, firms' profits go down to zero (not shown in Fig. 5). Since firms operate with fewer workers on their task range, wage inequality declines because of the resulting composition effect.
Considering the effects of our four automation experiments, we observe that interestingly the pattern of changes of total output and average real wages across experiments is different compared to the no entry and exit case. Under automation deepening average real wages are higher compared to the baseline now, whereas the  opposite effect occurs without entry and exit. Furthermore, again in contrast to the case without exit and entry, total real output is higher with an increase in machine productivity compared to the total real output after an increase in labor productivity. Both of these observations are driven by the different changes in the number of firms induced under automation deepening compared to labor augmenting technological change. Whereas the former leads to the entry of additional firms, the latter results in a smaller long-run number of firms compared to the baseline without a technology shock. The mechanism underlying this difference is essentially the same that induces an increase (decrease) of profits due to high capital (labor) productivity in the case without exit and entry. The fact that there is a larger long-run number of firms in the industry with automation deepening than with labor augmenting technological change is the dominant factor in explaining why total output in the industry now is larger in the scenario with a capital productivity increase compared to a labor productivity increase. The higher output results in a lower price of the consumption good and this price decrease is sufficiently strong to induce higher real wages under automation deepening compared to the baseline although nominal wages (not shown here) are actually lower. The change in nominal wages is the result of the interplay of two effects: a composition effect that increases wages because fewer (and mainly high level) tasks are done by workers and a demand effect. This second effect is negative, the effect of substitution of labor with capital on the firm level outweighs the additional labor demand due to firm entry. Under labor augmenting technological change both the composition effect and the demand effect have opposite signs compared to automation deepening. Again the demand effect dominates such that already nominal wages are larger compared to the baseline. The fact that the consumption good price is lower, due to higher output, compared to the baseline, induces that the positive effect of an increase in labor productivity on real wages is even stronger. As mentioned above, the level of wage inequality in this scenario with entry and exit is substantially lower compared to the case with high barriers to entry. This is mainly driven by a composition effect since in the scenario with entry and exit firms on average fill a smaller set of tasks with workers. The fact that the reduction in inequality is mainly due to a reduction in within firm inequality becomes apparent from the observation that the fraction of the Theil index stemming from within firm inequality is lower in Fig. 5 compared to Fig. 2. Considering the effect of the different types of automation on wage inequality and its distribution on within and between firm components, the qualitative findings obtained without exit and entry, however, carry over also to the scenario with no entry barriers.
Heterogeneous general skills of workers Finally, we turn to the case of a competitive economy where firms can enter and exit the market, and workers' general skills are heterogeneous. 7 Again, we compare the effects of the automation shocks with those Relative emp rate high to low skill There is market entry and exit, firms are homogeneous, and workers differ with respect to general skills. Treatments are: 0 -baseline, 1 -deepening of automation, 2 -labor augmenting technological advances, 3 -deepening of automation and labor augmenting technological advances, 4 -shift in tasks observed in the no entry and exit scenario with heterogeneous skills analyzed earlier in Section 4.2.1. As we have already observed for the case with free entry and homogeneous general skills, also in the case with heterogeneous skills total real output and the labor share increase as firms enter the market. Wage inequality is lower for all types of automation. Furthermore, allowing for entry and exit of firms changes the effects that automation deepening or labor augmenting technological change have on the average real wages and total output. The qualitative pattern, however, is the same as for the case of homogeneous general skills of workers, and so are the underlying mechanisms. To save space we do not illustrate these observations with separate figures.
What qualitatively differs is the effect of a higher labor or machine productivity on employment of the high skill workers. Figure 6 summarizes these findings. Without entry and exit of firms, high skill employment decreases with more productive machines. With entry of firms, high skill employment is slightly increasing with more productive machines. The underlying mechanisms explaining the observation is related to the entry of new firms. These new firms employ additional high skill workers on their high tasks. This overcompensates the fewer employment opportunities of the high skill workers on lower tasks, which is associated with a higher machine productivity. In fact, we can check (not shown in the figures) that the employment rate of the high skill workers and the low skill workers on lower tasks falls. While employment of the high skill workers increases with higher labor productivity in the scenario without entry and exit, it hardly changes in the scenario with an endogenous number of firms. Here firms exit the market after an increase in labor productivity, which worsens the employment opportunities of the workers. This counteracts the positive effect on employment chances that comes with the firms' decision to run more tasks with workers (who have become more productive).

Conclusion
In this paper, we study the effects of different types of automation on output, the wage distribution, and the labor share in a dynamic industry model with a taskbased production technology on the firm level. We explicitly model the (adaptive) process through which firms operating in an uncertain environment with labor market frictions allocate tasks to workers respectively machines and also consider the implications of high respectively low barriers to entry for the effect of automation. Furthermore, we capture complementarity between task levels and required worker skills.
Our analysis yields several key insights. First, we demonstrate that in spite of the considered frictions and myopic decision rules of the firms a large degree of coordination evolves in the industry with workers being allocated to tasks above a threshold, which is almost uniform across firms. Second, in the presence of high barriers to entry into the industry, labor augmenting technological change, i.e. an increase in labor productivity, has stronger output expanding effects compared to a comparable increase in machine productivity, which we refer to as automation deepening. In the absence of entry barriers this relationship is reversed. Third, whether automation deepening results in a decrease or an increase of real wages depends on the size of entry barriers. Finally, we show that the different types of automation have qualitatively different effects on the wage level and inequality based on the interplay of composition effects and labor demand effects. In Table 3, we summarize our discussion of the differently interacting mechanisms yielding these insights.  (1) and (2)  The first line lists the underlying effects on total output, firm profits, ave. real wages, and the Theil index. Upper part of table relates to deepening of automation experiment, lower part to labor augmenting automation. In the last column (total effect), the first entry refers to the case with a constant number of firms and the second to the case with entry and exit. In case the sign of an underlying effect is the same in both experiments, a '++' (or '--') indicates for which experiment the effect is stronger Our qualitative findings on the industry level are shown to be robust with respect to heterogeneities of firms and workers, where the impact of automation is, however, substantially different for workers with different general skills.
More generally, our analysis highlights in an evolutionary setting, in which firms and workers adaptively react to technological change, how the qualitative effects of different types of automation depend on industry characteristics, like barriers to entry and agent heterogeneity. Our analysis has empirically testable implications, in particular with respect to the importance of composition effects as drivers of changes in wage inequality. Our results suggest that the evolution of within firm wage inequality plays an important role in determining distributional effects of automation. From a policy perspective these insights have important implications for the type of automation a policy maker who is concerned about distributional effects should foster. Also, they show that an active industrial policy aiming to reduce barriers to entry helps to avoid negative (real) wage effects of automation.
Whereas, in this paper, we focus on the implications of a single exogenous technology shock, the developed framework also is suitable for expanding our analysis to repeated automation steps and also for considering firm actions, like training measures, which potentially accompany technological change and automation. Furthermore, due to our focus on task allocation decisions of firms, in this paper, we have abstracted from strategic quantity decisions of firms, assuming that the scale of the production process of each firm is fixed. Incorporating strategic quantity decisions by firms into our framework could shed additional light on the implications of automation on industry dynamics. Finally, we conduct our analysis within a partial model neutralizing demand side effects and focusing on one industry. This may be warranted by our consideration of particular cases of technological change, where the properties of the final product are not affected by the degree of automation in the production process. Furthermore, the focus on one industry implies that we do not consider mobility of workers or consumers across sectors. Endogenizing workers' labor supply decisions or demand side effects would require to explicitly model other sectors and their dynamics. Considering these additional aspects is beyond the scope of the current paper, but opens many avenues for future work.